You can split the file of your functions into several files, but remember that if you need more files, downloading can be even slower because you need more I / O commands to load different files.
Moreover, you separate files by functionality. If you feel that all these functions belong to each other, keep them together in this file. This will not slow down your script.
If you like, you can put functions in (static) classes and use the autoloader to load the file, but I am not a supporter of this solution. I believe that static classes are just a pretext for getting functions (and vars) from the global realm, and creating classes just for automatic loading is an abuse of autoload functionality. Of course, if you create a more object-oriented script, using classes also makes sense, and loading them can be convenient.
GolezTrol Jul 28 '11 at 8:43 2011-07-28 08:43
source share