Hey.
I have a problem with PHP’s __autoload option when certain errors occurs. I have these test files to try to locate the problem.
index.php
[code=php]function class_load($sClass) {
include “message.php”;
}
function e_handler($errno, $errstr, $errfile, $errline) {
msg::add($errstr);
}
spl_autoload_register( “class_load” );
set_error_handler( “e_handler” );
include “badFile.php”;
message.php
[code=php]class msg {
public static function add($message) {
echo $message.”<br /><br />”;
}
}
badFile.php
[code=php]abstract class testClass {
abstract public static function();
}
When I execute index.php, the server will make an E_STRICT error because of the abstract static method in badFile.php. But, PHP does NOT call my autoload function. I get this error “Fatal error: Class ‘msg’ not found in …”;
Why does the autoload function not get called?