#38325 [Ver->Csd]: spl_autoload_register() gaves wrong line for "class not found"

From: Date: Mon, 08 Jan 2007 04:27:38 +0000
Subject: #38325 [Ver->Csd]: spl_autoload_register() gaves wrong line for "class not found"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107307@lists.php.net to get a copy of this message
ID: 38325 Updated by: iliaa@php.net Reported By: marcos dot neves at gmail dot com -Status: Verified +Status: Closed Bug Type: SPL related Operating System: WINXP PHP Version: 5CVS-2006-08-04 (snap) New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-08-04 03:38:52] marcos dot neves at gmail dot com 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 this bug report at http://bugs.php.net/?id=38325&edit=1

« previous php.bugs (#107307) next »