Re: Assign array with __get

From: Date: Fri, 26 Mar 2010 00:21:07 +0000
Subject: Re: Assign array with __get
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-47633@lists.php.net to get a copy of this message
I guess you're gonna hate this :)

So what you're saying is that it is *consistent* with regard to the
implementation of methods/functions, i.e. __get  behaves as an
ordinary method.

On Fri, Mar 26, 2010 at 1:49 AM, Stanislav Malyshev <stas@zend.com> wrote:
> Hi!
>
>> So, what's the reasoning behind this design decision? Why is it supposed
>> to work like this and not the other way around?
>
> Because when you return something by-value you can not have effects of its
> modification reflect on the original value. That's how by-value works. When
> you have by-ref return you can modify it and have the original value change.
> More here: http://php.net/references
> --
> Stanislav Malyshev, Zend Software Architect
> stas@zend.com   http://www.zend.com/
> (408)253-8829   MSN: stas@zend.com
>



-- 
Ionut G. Stan
I'm under construction  |  http://blog.igstan.ro/


Thread (25 messages)

« previous php.internals (#47633) next »