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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
10 + 23 = ?
Subscribe to this entry?

 
 [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: Sun Apr 28 10:01:30 2024 UTC