Re: [RFC] Square brackets shortcut
| From: | Mark Dennehy | Date: | Fri, 11 Jan 2008 14:28:51 +0000 |
| Subject: | Re: [RFC] Square brackets shortcut | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34725@lists.php.net to get a copy of this message | ||
On Jan 11, 2008 2:17 PM, Geoffrey Sneddon <foolistbar@googlemail.com> wrote:
> I don't think tiredness to type an extra five characters should be an
> excuse to change the syntax.
No, but clarity of expression is a valid reason to do so.
> > a) Commit square bracket array shortcut patch
> > keys and values are separated by colons.
> Breaks from PHP's => for no apparent reason (one character too many
> character this time?), which is just confusing (that's an implicit -1).
Agreed;
> > b) Commit square bracket array shortcut patch
> > keys and values are separated by double arrows.
> Breaks backwards compatibility to save typing five characters. See
> above. -1.
>
It doesn't break backwards compatibility; the new syntax is an alias, not a
replacement. The older array() syntax will still be in place, if I've
understood the earlier posts correctly.
--
Mark Dennehy