5 ms·
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
by tored 5y ago
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".
- dten 5y agoYou 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 5y agoThat's not done lazily which is considered bad