I have the set_error_handler()
function set to call a function when there is an error.
In that function I have my own implementation of the exception class:
function acs_error_handler($errno, $errstr, $errfile, $errline) {
throw new acs_exception($errstr, $errno);
}
This gives me the following error:
Fatal error: Class 'acs_exception' not found
For some reason, this function does not call my autoload function which I have set up using:
spl_autoload_register('__autoload');
If I add the line:
__autoload('acs_exception');
before calling the class in the error function it all works.
My question is: Shouldn't the __autoload()
function fire when I call the acs_exception class in the error trigger function??