php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48386 ArrayObject and __wakeup()
Submitted: 2009-05-25 15:31 UTC Modified: 2010-05-18 15:41 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 3 (66.7%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: david at grudl dot com Assigned: colder (profile)
Status: Not a bug Package: SPL related
PHP Version: 5.3CVS-2009-05-25 (snap) OS: *
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-18 15:41 UTC] mike@php.net
-Status: Assigned +Status: Bogus
 [2010-05-18 15:41 UTC] mike@php.net
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);
  }
}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC