Ralph Schindler wrote:
>
> what version of php are you using?
>
> $session = new Zend_Session();
> $session->some_variable = "blah";
>
> should work fine in any php >= 5.1.0
>
Stupid me, I forgot that __get/__set et al don't have to be public to
function properly in php >= 5.1.0. Is this true of all magic methods?
Ralph Schindler wrote:
>
> The reason it was made protected was to prevent the masses from using
> the __get()/__set()/__isset()/__unset() methods directly, as that usage
> is frowned upon.. ie: $session->__get($name);
>
> The reason is to protect from unintentional misuse. As this scenario:
>
> $session = new Zend_Session();
> $var = array('foo'=>'bar');
> $session->__set($var, 'value');
>
> Would produce unexpected results.
>
Good to know. I'll be sure to keep that in mind.
--
View this message in context:
http://www.nabble.com/Zend_Session-Rev-1662-tf2648339s16154.html#a7390942
Sent from the Zend Framework mailing list archive at Nabble.com.