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

 ID:               48386
 Updated by:       [email protected]
 Reported by:      david at grudl dot com
 Summary:          ArrayObject and __wakeup()
-Status:           Assigned
+Status:           Bogus
 Type:             Bug
 Package:          SPL related
 Operating System: *
 PHP Version:      5.3CVS-2009-05-25 (snap)
 Assigned To:      colder

 New Comment:

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);

  }

}


Previous Comments:
------------------------------------------------------------------------
[2009-05-25 15:31:42] 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


------------------------------------------------------------------------



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

Reply via email to