Bug #48386 [Asn->Bgs]: ArrayObject and __wakeup()
| From: | mike@php.net | Date: | Tue, 18 May 2010 13:41:56 +0000 |
| Subject: | Bug #48386 [Asn->Bgs]: ArrayObject and __wakeup() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150561@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=48386&edit=1
ID: 48386
Updated by: mike@php.net
Reported by: david at grudl dot com
Summary: ArrayObject and __wakeup()
-Status: Assigned
+Status: Bogus
Type: Bug
Package: SPL related
Operating System: *
PHP Version: 5.3CVS-2009-05-25 (snap)
Assigned To: colder
New Comment:
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);
}
}
Previous Comments:
------------------------------------------------------------------------
[2009-05-25 15:31:42] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=48386&edit=1