Re: RFC: Short syntax for Arrays (redux)
| From: | Ilia Alshanetsky | Date: | Tue, 31 May 2011 22:03:37 +0000 |
| Subject: | Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52599@lists.php.net to get a copy of this message | ||
On Tue, May 31, 2011 at 11:59 PM, Rasmus <rasmus@lerdorf.com> wrote:
> On 05/31/2011 02:45 PM, Ilia Alshanetsky wrote:
>> Rasmus,
>>
>> Don't you think having support for both ['a':1, 'b':2] and
>> {'a':1,
>> 'b':2} would create confusion?
>
> Not if we present this as native json support in PHP. Then we have to
> support the {} version. Other than a couple of grumpy old-timers, I
> think we are in agreement that we should add a short array syntax.
> Whether we should extend that to also add a short object syntax is a
> secondary question.
I guess if you present it as a native json support in PHP, it probably
would be ok from clarity standpoint. Overloading {} parser should be
doable, but a little trickier than []. The + of the current patch is
that it is very nice and simple.