RE: [PHP-DEV] PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
| From: | Dmitry Stogov | Date: | Wed, 19 Jul 2006 17:03:07 +0000 |
| Subject: | RE: [PHP-DEV] 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-24702@lists.php.net to get a copy of this message | ||
Of course we can.
I'll look into the problem.
Dmitry.
> -----Original Message-----
> From: Andrei Zmievski [mailto:andrei@gravitonic.com]
> Sent: Wednesday, July 19, 2006 8:24 PM
> To: Dmitry Stogov
> Cc: Marcus Boerger; internals@lists.php.net; Andi Gutmans
> Subject: Re: [PHP-DEV] PHP 5.2-dev "Cannot use array returned
> from foo::__get('bar') in write context"
>
>
> But how is foreach() a write context? Unless you mean that
> someone uses
> foreach($f->bar as &$val) { .. }. Can we detect that though?
>
> -Andrei
>
> On Jul 19, 2006, at 8:22 AM, 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.
> >
> > Thanks. Dmitry.
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
>