|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59564 APC 'forgets' static properties
Submitted: 2011-01-07 04:56 UTC Modified: 2011-01-07 05:45 UTC
Avg. Score:4.1 ± 1.3
Reproduced:6 of 7 (85.7%)
Same Version:2 (33.3%)
Same OS:1 (16.7%)
From: peter at desk dot nl Assigned:
Status: Wont fix Package: APC (PECL)
PHP Version: 5.3.2 OS: Linux Ubuntu 10.04
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: peter at desk dot nl
New email:
PHP Version: OS:


 [2011-01-07 04:56 UTC] peter at desk dot nl
I have some classes that use static properties. When using the Serializable interface and accessing these properties during (un)serialization, the static properties of the class are undefined. Problem disappears when apc is turned off.

Reproduce code:

class SerTest implements Serializable {

  private static $foo = 'bar';

  public function __construct() {}

  public function serialize() {
    return serialize(self::$foo);

  public function unserialize($data) {}


$test = new SerTest();
$_SESSION['test'] = $test;


Expected result:
expect blank output.

Actual result:
after the second load :

Fatal error: Access to undeclared static property: SerTest::$foo in /var/www/serialize.php on line 10


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-07 05:45 UTC]
APC does cleanup of class specific data during its exit.

You can either juggle your extension loading order to load session before apc, so that the session handlers are called without failures.

Or, just do an auto_append_file which contains a session_write_close(); explicitly.
 [2012-01-04 15:20 UTC] astewart at online-buddies dot com
This happens to us, too. Workaround of reordering extensions doesn't work when 
the session module is compiled in and APC is not.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 08:01:29 2024 UTC