Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
tored
· 4y ago · 0 comments
PHP can't autoload functions, only classes. Thus if you wrap it in a static function inside a class you can autoload the the function by calling the class, Pipe::new(...), without doing a require "file.php".
Comments
[–]
dten
4y ago
You can add a file import to composer, which is built into vendor/autoload.php automatically. I suppose this allows you to load this as a package...
[–]
CiaranMcNulty
4y ago
That's not done lazily which is considered bad