|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2009-05-25 15:31 UTC] david at grudl dot com
 Description:
------------
Unserialization of ArrayObject descendants doesn't call __wakeup in PHP 5.3.
Reproduce code:
---------------
class Test extends ArrayObject
{
	public function __wakeup()
	{
		echo 'hey';
	}
}
$test = new Test;
$dolly = unserialize(serialize($test));
Expected result:
----------------
-> hey
Actual result:
--------------
none
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 12:00:01 2025 UTC | 
For classes implementing the Serializable interface, $obj->unserialize($serializedData) is called instead of __wakeup(): class Test extends ArrayObject { function unserialize($serialized) { echo "Hey!\n"; return parent::unserialize($serialized); } }