Bug #71202 [Opn->Csd]: Autoload function registered by another not activated immediately

From: Date: Wed, 23 Dec 2015 15:48:31 +0000
Subject: Bug #71202 [Opn->Csd]: Autoload function registered by another not activated immediately
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198167@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71202&edit=1 ID: 71202 Updated by: laruence@php.net Reported by: web001 at zeroj dot net Summary: Autoload function registered by another not activated immediately -Status: Open +Status: Closed Type: Bug Package: SPL related Operating System: OS X 10.10.1 PHP Version: 7.0.1 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=e21cb2daeabe459db996407df2113bb47a320937 Log: Fixed bug #71202 (Autoload function registered by another not activated immediately) Previous Comments: ------------------------------------------------------------------------ [2015-12-23 13:22:33] web001 at zeroj dot net Description: ------------ See test script. An autoload function was added to autoload queue in another autoload function. But the "child" autoload function was not called after other functions. It works on 5.5 and 5.6. Test script: --------------- <?php spl_autoload_register(function($name){ if($name == 'C') { spl_autoload_register(function($name){ if($name == 'C') { class C { function __construct(){ echo "I'm C.\n"; } } } }); } }); $c = new C(); Expected result: ---------------- I'm C. Actual result: -------------- PHP Fatal error: Uncaught Error: Class 'C' not found ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71202&edit=1

« previous php.bugs (#198167) next »