strange autoload behavior

From: Date: Thu, 10 Jul 2008 03:29:34 +0000
Subject: strange autoload behavior
Groups: php.internals 
Request: Send a blank email to internals+get-38886@lists.php.net to get a copy of this message
Hi! I think I found a bug but before posing it to bugs.php.net I would like to ask your opinion. I think the it is not a planed behavior that some errors doesn't "bubble up" from autoload, but at least the error message is misleading. --------------------------------------------- foo.php: <?php throw new Exception(); class foo {} ?> bar.php: <?php class bar extends foo {} ?> bootstrap.php <?php function __autoload($className) { include $className.'.php'; } new bar(); ?> --------------------------------------------- Result: "Fatal error: Class 'bar' not found". The code above seems not to be too realistic but the next one is: --------------------------------------------- foo.php: <?php define('error', oops_i_left_the_quotes); class foo {} ?> bar.php: <?php class bar extends foo {} ?> bootstrap.php <?php function __autoload($className) { include $className.'.php'; } function error_handler() { throw new Exception(); } set_error_handler("error_handler"); new bar(); ?> --------------------------------------------- Result: "Fatal error: Class 'bar' not found". And for example if define a class level constant without quotes I get the exception generated by the Notice. Best Regards, Felhő

« previous php.internals (#38886) next »