Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
| From: | Christian Stocker | Date: | Wed, 19 Jul 2006 15:37:19 +0000 |
| Subject: | Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context" | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24688@lists.php.net to get a copy of this message | ||
On 19.7.2006 17:22 Uhr, 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.Fine, but I'm now wondering, where's the write context in foreach($f->bar as $key => $value) { } Just wondering as the error message is very missleading for a core-outsider, which only sees reads from that array and no modifications to it. chregu, off to change its code now :) -- 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