php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38325 spl_autoload_register() gaves wrong line for "class not found"
Submitted: 2006-08-04 03:38 UTC Modified: 2007-01-08 04:27 UTC
From: marcos dot neves at gmail dot com Assigned:
Status: Closed Package: SPL related
PHP Version: 5CVS-2006-08-04 (snap) OS: WINXP
Private report: No CVE-ID: None
 [2006-08-04 03:38 UTC] 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)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-08 04:27 UTC] iliaa@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 14:01:28 2024 UTC