Re: RFC: Short syntax for Arrays (redux)
| From: | dukeofgaming | Date: | Tue, 31 May 2011 21:46:28 +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-52591@lists.php.net to get a copy of this message | ||
On Tue, May 31, 2011 at 4:36 PM, dukeofgaming <dukeofgaming@gmail.com>wrote:
> Hi,
>
> I'm glad the topic has been picked up again, but I think there is an
> inconsistency in the proposal now that we are talking about being JSON-ish:
> JSON describes objects, not arrays. Then, what if "[]" were used for arrays
> and "{}" for objects?, so that:
>
> [1,2,3] //array(0=>1, 1=>2, 2=>3)
> ['one':1, 'two':2, 'three' : 3] // array('one'=>1,
> 'two'=>2, 'three' => 3)
> ['one':1, 'two':2, 'three' : 3] //
> (object)array('one'=>1, 'two'=>2,
> 'three' => 3)
>
>
Err, I meant:
{'one':1, 'two':2, 'three' : 3} //
(object)array('one'=>1, 'two'=>2, 'three'
=> 3)