Bug #67436 [Ver]: Autoloader isn`t called if user defined error handler is present

From: Date: Sun, 15 Jun 2014 18:16:37 +0000
Subject: Bug #67436 [Ver]: Autoloader isn`t called if user defined error handler is present
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186201@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67436&edit=1 ID: 67436 Updated by: levim@php.net Reported by: wolkerstorfer at xortex dot at Summary: Autoloader isn`t called if user defined error handler is present Status: Verified Type: Bug Package: Unknown/Other Function Operating System: Debian Wheezy PHP Version: 5.5.13 Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2014-06-15 16:37:52] levim@php.net Verified that this is a problem in PHP 5.4.24 on Mac OS X 10.9.3. ------------------------------------------------------------------------ [2014-06-13 10:13:44] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67436&edit=1

« previous php.bugs (#186201) next »