#38325 [NEW]: spl_autoload_register() gaves wrong line for "class not found"

From: Date: Fri, 04 Aug 2006 03:38:52 +0000
Subject: #38325 [NEW]: spl_autoload_register() gaves wrong line for "class not found"
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-100314@lists.php.net to get a copy of this message
From: marcos dot neves at gmail dot com Operating system: WINXP PHP version: 5CVS-2006-08-04 (snap) PHP Bug Type: SPL related Bug description: spl_autoload_register() gaves wrong line for "class not found" Description: ------------ <? //spl_autoload_register(); new Foo(); ?> The code above gives-me: Fatal error: Class 'Foo' not found in autoLoad.php on line 5 That´s ok, the line shows where the error occurs. Uncomment the spl_autoload_register() and the error will become: Fatal error: Class 'Foo' not found in autoLoad.php on line 7 The line error, goes to the last line of the script. Inside a big script, with many requires, can be very difficult to find where the errors really occurs Reproduce code: --------------- <? //spl_autoload_register(); // uncomment to test the bug new Foo(); ?> Expected result: ---------------- Fatal error: Class 'Foo' not found in autoLoad.php on line 5 Correct line Actual result: -------------- Fatal error: Class 'Foo' not found in autoLoad.php on line 7 Wrong line (always the last one) -- Edit bug report at http://bugs.php.net/?id=38325&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38325&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38325&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38325&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38325&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38325&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38325&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38325&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38325&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38325&r=support Expected behavior: http://bugs.php.net/fix.php?id=38325&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38325&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38325&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38325&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38325&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38325&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38325&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38325&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38325&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38325&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38325&r=mysqlcfg

« previous php.bugs (#100314) next »