Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context"
| From: | Pierre | Date: | Wed, 19 Jul 2006 19:42:54 +0000 |
| Subject: | Re: PHP 5.2-dev "Cannot use array returned from foo::__get('bar') in write context" | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-24720@lists.php.net to get a copy of this message | ||
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: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.fixes the code.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)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.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.
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. --Pierre