Re: [VOTE] Uniform Variable Syntax

From: Date: Mon, 07 Jul 2014 14:46:30 +0000
Subject: Re: [VOTE] Uniform Variable Syntax
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-75315@lists.php.net to get a copy of this message
On 7 Jul 2014, at 15:42, Laruence <laruence@php.net> wrote:

> 1. "The current patch introduces a new “write context” issue. Namely
> ($foo)['bar'] = 'baz' will not behave this same was as
> $foo['bar'] =
> 'baz'. In the former case an undefined variable notice will be thrown
> if $foo does not exist, whereas the latter does not throw a notice."
> 
> 2. "As these changes only apply to some very rarely used syntax, the
> breakage seems acceptable for PHP 6."
> 
> 
> I don't think we should introduce a new thing which is not perfect or
> "confused".. it looks like we fixed a mess with a new mess.
> 
> it make me think we should : "don't fix it until it is broken”

We are fixing what is broken here; the variable syntax is counter-intuitive at the moment, and they
make the syntax more consistent overall.

Also, parentheses in PHP are always a source of issues. I don’t think they’ll ever quite work
properly unless we switch to using an AST-based parser someday.
--
Andrea Faulds
http://ajf.me/






Thread (18 messages)

« previous php.internals (#75315) next »