note 25812 deleted from language.oop.magic-functions by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 18:55:16 +0000 |
| Subject: | note 25812 deleted from language.oop.magic-functions by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162515@lists.php.net to get a copy of this message | ||
Note Submitter: michael_muir at dstoutput dot com
----
The description isn't particularly clear about this, but it appears that if any variables
identified in the array returned by __sleep() are objects, __sleep() will in turn be called on those
objects. This is particularly useful if you have many levels of subordinate objects (not subclasses)
stored in (for example) arrays. Simply return the array name from the 'top level'
object's __sleep() and define a __sleep() for the object's class within the subordinate
arrays and it shall be called for each.