Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
| From: | Michael Wallner | Date: | Wed, 19 Jul 2006 15:28:43 +0000 |
| Subject: | Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context" | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24682@lists.php.net to get a copy of this message | ||
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 with you and Marcus here, but since when does foreach() need write context? Maybe just a weird idea, but what about a &__ref(name) overload function? -- Michael