note 114700 deleted from function.autoload by crell
| From: | crell@php.net | Date: | Mon, 04 Apr 2022 16:26:06 +0000 |
| Subject: | note 114700 deleted from function.autoload by crell | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-218048@lists.php.net to get a copy of this message | ||
Note Submitter: Ben
----
Guys, this document ( i mean __autoload() ) not mentioned one special situation: if you both use
__autoload() and spl_autoload_register(), the __autoload() function will never to be called.
Although spl_autoload_register() documentation explained why, i decide to wrote this in case some
one get confused and waste all day to figure out why.
Here is some code to verify above:
<?php
function __autoload($class) {
}
function my_loader() {
}
function your_loader() {
}
var_dump ( spl_autoload_functions () );
echo '<br/>';
spl_autoload_register ( 'my_loader' );
spl_autoload_register ( 'your_loader' );
var_dump ( spl_autoload_functions () );