从
php.net开始:
原文链接:https://www.f2er.com/php/133266.htmlIn PHP 5,this is no longer necessary. You may define an 07001 function which is automatically called in case you are trying to use a class/interface which hasn’t been defined yet. By calling this function the scripting engine is given a last chance to load the class before PHP fails with an error.
现在我想知道,单独使用__autoload在动态网站上加载适当的类是不好的做法吗?
我的网站设置方式是将文件包含在index.PHP文件中,例如http://www.site.com/index.php?p=PAGE-I-WANT-TO-LOAD
因此,如果我在论坛部分或我网站的博客部分,我只想加载适当的类和函数,所以我使用自动加载,但我从不手动包含文件,如果我使用__autoload作为最后的手段或是即使在高流量系统上,我做得还不错?