|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60658 autoload broken in ZTS mode
Submitted: 2012-01-04 19:42 UTC Modified: 2013-02-18 00:35 UTC
Avg. Score:4.6 ± 0.8
Reproduced:9 of 9 (100.0%)
Same Version:6 (66.7%)
Same OS:4 (44.4%)
From: fedora at famillecollet dot com Assigned:
Status: No Feedback Package: APC (PECL)
PHP Version: 5.4SVN-2012-01-04 (snap) OS: GNU/Linux (Fedora 16)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: fedora at famillecollet dot com
New email:
PHP Version: OS:


 [2012-01-04 19:42 UTC] fedora at famillecollet dot com
httpd + PHP 5.4.0RC5-dev (201201041830) + APC (svn 316786) : OK.

httpd.worker + PHP in ZTS mode without APC in ZTS mode : OK.

httpd.worker + PHP in ZTS mode + APC in ZTS mode : 
__autoload or spl_autoload_register only works on first call.

Test script:
Connect to phpMyAdmin

Minimal script.
function my_autoload($name) {
 echo "autoload $name\n";
echo "Start\n";

Expected result:
autoload Foo
In foo class

(which is also the result on first call, after apache start)

Actual result:
autoload Foo

Fatal error:  Call to undefined method Foo::run() in /home/remi/public_html/autotest.php on line 8


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-02 15:34 UTC] xrstf-misc at yahoo dot com
The same happens to me using

Win7 x64
PHP 5.4.0 TS VC9 x86
Apache 2.2.19 x86
APC 3.1.9 (win7-DLL for 5.4 from

My script attempts to load a class, which succeeds the first time it's run. The 
second run stops with "undefined method MyClass::foo" message, even though a


right before the call to foo() correctly lists foo() as one of the methods in 

Disabling APC resolves the problem for me.
 [2012-03-08 22:32 UTC]
please test with the patch from
 [2012-03-09 16:12 UTC] rk at mac dot hush dot com
I can confirm the patch from seems to fix 
the problem.
 [2012-03-09 16:23 UTC]
With APC rev324037, autoload still doesn't work for me (Gnu/linux, ZTS build).
 [2012-03-10 00:14 UTC] luath at hushmail dot com
The patch seems to work for me on rev 324069 (Win7 x64, ZTS build). Tested using 
provided test script.
 [2012-03-12 15:30 UTC]
I confirm that rev 324141 fix this bug (which is probably a duplicate of #61219)
 [2012-03-18 13:22 UTC]
Please try using this snapshot:
For Windows:

 [2012-03-18 13:22 UTC]
-Status: Open +Status: Feedback
 [2012-03-18 17:53 UTC]
Yes, I confirm (again) that with rev324329 autoload works in NTS and ZTS mode
 [2013-02-18 00:35 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon May 29 02:03:39 2023 UTC