News for hackers. Stuff that matters.
Re:PHP Pipes in 156 Bytes by tored on Thursday March 03, 2022 @10:58AM (#30542634)
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".
Re:PHP Pipes in 156 Bytes by dten on Thursday March 03, 2022 @11:07AM (#30542781)
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...
Re:PHP Pipes in 156 Bytes by CiaranMcNulty on Thursday March 03, 2022 @11:13AM (#30542858)
That's not done lazily which is considered bad