Re[2]: [PHP] Serializing objects and storing them is sessions [fixed]
| From: | Kelly Hallman | Date: | Sat, 10 Apr 2004 04:49:35 +0000 |
| Subject: | Re[2]: [PHP] Serializing objects and storing them is sessions [fixed] | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-183054@lists.php.net to get a copy of this message | ||
Apr 10 at 1:39pm, Tom Rogers wrote:
> Is your __sleep() function returning the array required by serialization?
Since you mentioned it, I tried returning an array and it did not
segfault, thought it was initially unclear what the array was for.
After reading over most of the documentation about serializing objects for
the Nth time, I finally found this sentence, which I didn't recall:
"It can clean up the object and is supposed to return an array with the
names of all variables of that object that should be serialized."
I guess that's pretty clear, but it's not the first time I missed a
half-sentence in the manual that provided a very key bit of information.
It doesn't help that this is the only mention within serveral full pages
related to the topic of serializing objects.
I think "must" seems more apropos than "supposed to" considering the
result/consequence... It's probably just my older version of PHP, but a
segfault seems like a pretty extreme error message :)
Thanks for pointing me in the right direction! It's so much easier to find
the explanation when you already have the answer....
--Kelly