php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67436 Autoloader isn't called if two method definitions don't match
Submitted: 2014-06-13 10:13 UTC Modified: 2014-06-15 20:30 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: wolkerstorfer at xortex dot at Assigned: bwoebi (profile)
Status: Closed Package: Unknown/Other Function
PHP Version: 5.5.13 OS: Debian Wheezy
Private report: No CVE-ID: None
 [2014-06-13 10:13 UTC] wolkerstorfer at xortex dot at
Description:
------------
If a user definded error handler is present the autoloader registered with spl_register_autoloader isn`t called in certain cases. This bug was not present in PHP 5.3 but can be reproduced in all Versions of 5.4 and 5.5

Test script:
---------------
https://docs.google.com/file/d/0ByiEkxk4BDg0cUE2ZzRuaXNRSjA/edit

Expected result:
----------------
To reproduce the bug please extract the ZIP file from the provided URL and run test.php. The autoloader is expected to require the other files (a.php, b.php, c.php) as needed.

Actual result:
--------------
"Fatal error: Class 'c' not found" occurs. If the custom error handler is removed the autoloader works as expected.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-06-15 16:37 UTC] levim@php.net
-Status: Open +Status: Verified
 [2014-06-15 16:37 UTC] levim@php.net
Verified that this is a problem in PHP 5.4.24 on Mac OS X 10.9.3.
 [2014-06-15 18:16 UTC] levim@php.net
A quick investigation shows that the body of this if branch is taken when looking up 'c': http://lxr.php.net/xref/PHP_TRUNK/Zend/zend_execute_API.c#949

949    /* The compiler is not-reentrant. Make sure we __autoload() only during run-time
950     * (doesn't impact functionality of __autoload()
951    */
952    if (!use_autoload || zend_is_compiling(TSRMLS_C)) {
953        if (!key) {
954            free_alloca(lc_free, use_heap);
955        }
956        return FAILURE;
957    }

use_autoload is set to 1, so it must be the zend_is_compiling call.
 [2014-06-15 20:19 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-06-15 20:19 UTC] bwoebi@php.net
-Status: Verified +Status: Closed
 [2014-06-15 20:25 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-06-15 20:30 UTC] bwoebi@php.net
-Summary: Autoloader isn`t called if user defined error handler is present +Summary: Autoloader isn't called if two method definitions don't match -Assigned To: +Assigned To: bwoebi
 [2014-06-15 20:30 UTC] bwoebi@php.net
The fix for this bug has been committed.

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/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2014-06-15 21:13 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-06-15 21:16 UTC] bwoebi@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-06-18 13:51 UTC] dmitry@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-06-19 00:53 UTC] tyrael@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-07-02 08:26 UTC] ab@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-07-02 08:34 UTC] ab@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-10-07 23:14 UTC] stas@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 [2014-10-07 23:25 UTC] stas@php.net
Automatic comment on behalf of bobwei9@hotmail.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=ca29063da5599f463454578abe629bc21ab33b3b
Log: Fix bug #67436
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC