note 31027 deleted from language.oop.magic-functions by danbrown
| From: | danbrown@php.net | Date: | Sat, 07 Nov 2009 18:55:12 +0000 |
| Subject: | note 31027 deleted from language.oop.magic-functions by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162513@lists.php.net to get a copy of this message | ||
Note Submitter: jan at sorgalla dot com
----
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;
}
}
?>