|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-10-19 06:06 UTC] kalle@php.net
[2010-10-19 06:06 UTC] kalle@php.net
-Assigned To:
+Assigned To: kalle
[2010-10-19 06:07 UTC] kalle@php.net
-Status: Assigned
+Status: Closed
[2010-10-19 06:07 UTC] kalle@php.net
[2020-02-07 06:09 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 13:00:01 2025 UTC |
Description: ------------ This was rejected as a note from the documentation with no explanation, I assume because it was considered a documentation bug: Example #1 would be better as: function __autoload($class_name) { include $class_name . '.php'; } Making it an include rather than a require makes it a warning if the file fails to load rather than a fatal, and PHP will instead fatal where the class is being used. The net result is that the error logs will report the actual source of the error rather than pointing to the autoloader. Removing the _once just makes it slightly more efficient since _once is not necessary inside of __autoload because it will only try to load a class if it's not already defined. More info: http://p3n.us/q7