Re: PHP5 : __sleep() and __wakeup()
| From: | Curt Zirzow | Date: | Thu, 12 Aug 2004 20:57:52 +0000 |
| Subject: | Re: PHP5 : __sleep() and __wakeup() | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-193643@lists.php.net to get a copy of this message | ||
* Thus wrote Frdric Hardy:
> I'am using php 5.0.0 release.
>
> Try this :
> var_dump($test);
> var_dump(unserialize(serialize($test)));
>
> You should obtain something like that for fist var_dump :
>
> object test
> string test -> 'var'
>
> and for the second var_dump :
>
> object test
> string test -> 'var'
> string test -> & null
Yep, seems to be a bug that when serialize gets the array of items
from __sleep, it doesn't add the scope of the variable:
object(foo)#2 (3) {
["var2"]=>
string(4) "var2"
["var1:private"]=>
string(3) "var"
["var1"]=>
NULL
}
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!