note 31027 added to language.oop.magic-functions
| From: | jan at sorgalla dot com | Date: | Mon, 07 Apr 2003 14:31:20 +0000 |
| Subject: | note 31027 added to language.oop.magic-functions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-46310@lists.php.net to get a copy of this message | ||
If you want to ensure that all object vars are saved completely, try this:
<?php
class Foo
{
function __sleep() {
$objectVars = get_object_vars($this);
$serializeVars = array();
foreach ($objectVars as $key => $val) {
$serializeVars[] = $sKey;
}
return $serializeVars;
}
}
?>
--
http://www.php.net/manual/en/language.oop.magic-functions.php
http://master.php.net/manage/user-notes.php?action=edit+31027
http://master.php.net/manage/user-notes.php?action=delete+31027
http://master.php.net/manage/user-notes.php?action=reject+31027