|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-15 10:30 UTC] neemah86 at gmail dot com
[2009-06-15 12:05 UTC] neemah86 at gmail dot com
[2009-10-05 09:47 UTC] colder@php.net
[2009-10-13 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 23:00:01 2025 UTC |
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