By jmathai
via jaisenmathai.com
Published: Jun 28 2008 / 10:04
PHP5 has an __autoload function which will handle automatically including class files when you use a class which has not yet been defined.
Comments
Sven Arild Helleland replied ago:
If you create the script with a proper layout/design from the start there is no reason to reply on __autoload() or include_once()/require_once().
Zarquod replied ago:
Wasn't there recently an article somewhere which stated, in a nutshell, that __autoload() is horribly expensive, performancewise, and therefore should be avoided ...!?
jmathai replied ago:
Cost is relative and building a scalable site doesn't hang on whether or not you use autoload. There are lots of tricks and tweaks you can use to change the behavior or file inclusions (amongst other things). For example, you can turn off apc.stat and you won't face the penalty of file system lookups when including a file.
Voters For This Link (9)
Voters Against This Link (1)