note 25812 added to language.oop.magic-functions

From: Date: Mon, 07 Oct 2002 17:21:32 +0000
Subject: note 25812 added to language.oop.magic-functions
Groups: php.notes 
Request: Send a blank email to php-notes+get-37751@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/language.oop.magic-functions.php http://master.php.net/manage/user-notes.php?action=edit+25812 http://master.php.net/manage/user-notes.php?action=delete+25812 http://master.php.net/manage/user-notes.php?action=reject+25812

« previous php.notes (#37751) next »