Edit report at http://bugs.php.net/bug.php?id=48388&edit=1

 ID:               48388
 Updated by:       m...@php.net
 Reported by:      david at grudl dot com
 Summary:          ArrayObject and __sleep()
-Status:           Assigned
+Status:           Closed
 Type:             Bug
 Package:          SPL related
 Operating System: *
 PHP Version:      5.2.9
 Assigned To:      colder

 New Comment:

Fixed in 5.3.


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/bug.php?id=48388&edit=1

Reply via email to