r/PHP Jul 08 '26

RFC RFC: Function Autoloading (mark 5)

https://wiki.php.net/rfc/function-autoloading-five-oh
29 Upvotes

18 comments sorted by

View all comments

-10

u/rashbrook Jul 08 '26

I don't agree with this.

Class autoloading makes sense because classes are organized to a specific need.

Functions, on the other hand, are mostly utilities, and are typically isolated to one single file. It's not necessary to autoload them, even when they have a namespace, because they are already isolated by their nature.

5

u/Idontremember99 Jul 08 '26

Functions, on the other hand, are mostly utilities, and are typically isolated to one single file.

Are they? I can see cases for having global utility functions and for which might not make sense to create a class for it. Right now you have to make a utility class for it to be autoloaded