|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48388 ArrayObject and __sleep()
Submitted: 2009-05-25 15:49 UTC Modified: 2010-05-18 16:25 UTC
Avg. Score:4.0 ± 1.0
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:3 (75.0%)
From: david at grudl dot com Assigned: colder (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.9 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.
Block user comment
Status: Assign to:
Bug Type:
From: david at grudl dot com
New email:
PHP Version: OS:


 [2009-05-25 15:49 UTC] david at grudl dot com
ArrayObject descendants can be forced to serialize public/protected/private properies using __sleep(), but it produces E_NOTICE

Reproduce code:
class Test extends ArrayObject
	public $var = 123;

	public function __sleep()
		return array('var');

$test = new Test;
$s = serialize($test);

Expected result:

Actual result:
Notice: serialize() [function.serialize]: "var" returned as member variable from __sleep() but does not exist


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-05-18 16:25 UTC]
-Status: Assigned +Status: Closed
 [2010-05-18 16:25 UTC]
Fixed in 5.3.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Nov 29 05:01:23 2020 UTC