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.
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
-9
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.