Re: [VOTE] Bare Name Array Literal/Dereference
| From: | Adam Harvey | Date: | Thu, 19 Jun 2014 23:57:20 +0000 |
| Subject: | Re: [VOTE] Bare Name Array Literal/Dereference | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-75006@lists.php.net to get a copy of this message | ||
I try to be in the habit of explaining my -1s, so I'll explain them
below. They're both reasons that came up in the earlier discussion
thread.
On 19 June 2014 16:44, Andrea Faulds <ajf@ajf.me> wrote:
> https://wiki.php.net/rfc/bare_name_array_literal#vote
Johannes isolated an issue I kind of danced around in my own thinking
here: http://news.php.net/php.internals/74694
— the difference in
behaviour between a constant called FOO when you have [FOO: ''] versus
[FOO => ''] is extremely unintuitive, and is going to burn users.
Sadly, this probably means there isn't a sensible way to implement
unquoted keys in PHP array declarations, no matter how you slice the
syntax. Such is life.
> https://wiki.php.net/rfc/bare_name_array_dereference#vote
As I said earlier, I think the syntax here is visually confusing with
object property/method access. If there was an obvious digraph that
was completely distinct from -> and still somehow implied array member
access I'd be more open to this, but I really can't think of one, and
:> isn't it.
Adam