|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-01-07 05:45 UTC] gopalv@php.net
[2012-01-04 15:20 UTC] astewart at online-buddies dot com
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 01:00:01 2025 UTC |
Description: ------------ 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: --------------- <?php class SerTest implements Serializable { private static $foo = 'bar'; public function __construct() {} public function serialize() { return serialize(self::$foo); } public function unserialize($data) {} } session_start(); $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