#48388 [Opn->Asn]: ArrayObject and __sleep()

From: Date: Thu, 16 Jul 2009 01:08:17 +0000
Subject: #48388 [Opn->Asn]: ArrayObject and __sleep()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139786@lists.php.net to get a copy of this message
ID: 48388 Updated by: colder@php.net Reported By: david at grudl dot com -Status: Open +Status: Assigned Bug Type: SPL related Operating System: * PHP Version: 5.2.9 -Assigned To: +Assigned To: colder Previous Comments: ------------------------------------------------------------------------ [2009-05-25 15:49:14] david at grudl dot com Description: ------------ 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: ---------------- none Actual result: -------------- Notice: serialize() [function.serialize]: "var" returned as member variable from __sleep() but does not exist ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48388&edit=1

« previous php.bugs (#139786) next »