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

From: Date: Wed, 19 Jul 2006 19:55:38 +0000
Subject: Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-24722@lists.php.net to get a copy of this message
Hello Pierre, Wednesday, July 19, 2006, 9:42:54 PM, you wrote: > On 7/19/06, Marcus Boerger <helly@php.net> wrote: >> Hello Pierre, >> >> Wednesday, July 19, 2006, 3:56:15 PM, you wrote: >> >> > On Wed, 19 Jul 2006 15:32:42 +0200 >> > christian.stocker@bitflux.ch (Christian Stocker) wrote: >> >> >> >> >> >> >> On 19.7.2006 15:24 Uhr, Richard Quadling wrote: >> >> > For PHP 5.2.0-dev (cli) (built: Jul 12 2006 12:20:25), I get ... >> >> > >> >> > Fatal error: Cannot use array returned from foo::__get('bar') in >> >> > write context in C:\- on line 16 >> >> > >> >> > But only once, not 1 per line. >> >> > >> >> > $f = new foo(); >> >> > $a = $f->bar; >> >> > foreach($a as $key => $value) >> >> > >> >> > fixes the code. >> >> > >> >> >> >> I know (forgot to mention it), but still annoying as I have to fix a >> >> lot of lines to do that. >> >> >> >> If there are technical reasons for the fatal error, fine, I have to >> >> live with it then. >> >> > If there is good reasons for this change, it should be a good candidate >> > for E_STRICT but not E_FATAL/RECOVERABLE. >> >> Wrong answer and not an option at all - sorry. But we are actually >> preventing potential SEGVs here. Just like the mighty reference thing that >> lead to PHP 4.4. > You don't have to answer in a bad way when Dmitry nicely already > explained the reasons. Especially when we all agreed on the main > cause. I only tried to explain that this situation does not fall in the category where E_STRICT is the answer and then gave a short explanation. >> Why not write one since you are obviously aware of this. I wasn't until this >> very momnet as i never use __get(), since i know it has too many issues and >> causes to many problems. So here i am probbaly the wrong person to write >> something. > I retire my offer, do it yourself, you know it better. And you should > have done it in the first place. Wow great. And later you i am the idiot to blame or what? Thanks for the help. Best regards, Marcus

« previous php.internals (#24722) next »