ID: 48556 User updated by: neemah86 at gmail dot com Reported By: neemah86 at gmail dot com Status: Open Bug Type: SPL related Operating System: Debian Lenny (FreeBSD 7.0 also) PHP Version: 5.2.9 New Comment:
Also forgot to mention, that fatal error is - "class 'someClass' not found in ... " Previous Comments: ------------------------------------------------------------------------ [2009-06-15 10:30:59] neemah86 at gmail dot com class definition is: __autoload_failed($className, $message) ------------------------------------------------------------------------ [2009-06-15 10:28:06] neemah86 at gmail dot com Description: ------------ Hi. Trying to throw exception from __autoload() by evaluating code (eval()). In earlier version of php5 that would give me exception that i need. Now it gives me fatal ignoring eval statement. Reproduce code: --------------- function __autoload_failed() { eval( 'if (!class_exists("ClassNotFoundException", false)) { ' .'final class ClassNotFoundException extends Exception {/*_*/} }' .'throw new ClassNotFoundException("'.$classname.': '.$message.'");' ); } function __autoload($className) { // insert your logic here __autoload_failed($className, 'not found'); // in any place, actually } Expected result: ---------------- ClassNotFoundException thrown Actual result: -------------- Fatal error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48556&edit=1