* Thus wrote Frdric Hardy:
> 
> class foo
> {
>     private $var = 'var';
>     ...
> 
>     function __sleep()
>     {
>         return array('var');
>     }
> }
> 
> and php code like this :
> 
> $myFoo = new foo();
> var_dump(serialize($myFoo));
>
> the 'var' property was not serialized because it is protected !!!
> However, if you do not defined __sleep() method, 'var' is serialized !!!
> Conclusion : the programmer can not define properties wich must be 
> serialized, but the language can serialized all properties, even if they 
> are private or protected !!!
> And if the prgrammer (me) want not to put in session all properties, it 
> is impossible !!!

what version are you running? this works perfectly fine:

  string(26) "O:3:"foo":1:{s:3:"var";N;}"


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!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to