Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"

From: Date: Wed, 19 Jul 2006 16:15:56 +0000
Subject: Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-24695@lists.php.net to get a copy of this message
On 19.7.2006 17:59 Uhr, Pierre wrote:
On Wed, 19 Jul 2006 19:22:47 +0400 dmitry@zend.com ("Dmitry Stogov") wrote:
__get() never worked in write context proper. It just CAN NOT work proper, because __get() returns by value (zval*), but modification requires address (zval**). We have a lot of __get() related bugs because of this situation in bugs.php.net. Month ago Marcus disabled usage of __get() in write context and I am completely agree with him We cannot use E_STRICT for this error and then SIGSEGV.
I agree too with the write mode. What I do not really understand is why this script produces a write mode, there is actually no write operations outside the hash position. For what Dmitri explained, foreach uses array in write context. It is required when foreach is done by ref. The open question is to know if it is possible to work in read mode in this case. Please reopen or create a bug report about this issue and assign it to Dmitri (requested by Dmitri).
done: http://bugs.php.net/bug.php?id=38146 chregu
Cheers, -- Pierre
-- christian stocker | Bitflux GmbH | schoeneggstrasse 5 | ch-8004 zurich phone +41 44 240 56 70 | mobile +41 76 561 88 60 | fax +41 1 240 56 71 http://www.bitflux.ch | christian.stocker@bitflux.ch | GPG 0x5CE1DECB

« previous php.internals (#24695) next »