Re: Re: RFC: Short syntax for Arrays (redux)
| From: | Dan Birken | Date: | Wed, 01 Jun 2011 00:29:30 +0000 |
| Subject: | Re: Re: RFC: Short syntax for Arrays (redux) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-52615@lists.php.net to get a copy of this message | ||
+1
To be honest, ['a': 'b'] or ['a' => 'b'] is so much
better than array('a' =>
'b') for general use I don't even care which one is picked, as long as one
of them is picked.
-Dan
On Tue, May 31, 2011 at 3:43 PM, Marcel Esser <marcel.esser@croscon.com>wrote:
> From the perspective of someone that's just trying to get stuff done:
>
> $packet = array('response' => array('status' => 1,'message'
> => ''),'data'
> => array('id' => 1, 'username' => 'john doe'));
>
> $packet = ['response': ['status': 1, 'message': '',
> 'data': ['id': 1,
> 'username': 'john doe'] ] ];
>
> The clarity improvement above is an exponential function that gets better
> and better the more deeply nested you are. I don't know anyone that needs
> the ability to support full JSON notation in PHP, but there are entirely too
> many deeply nested array() declarations with lots of tabs in our lives,
> especially when we start working with things like JSON and/or Mongo or xyz.
>
> That's all I wanted to say to this.
>
> Cheers,
> M.
>
> --
> Marcel Esser
> Vice President of Engineering, CROSCON
> +1 (202) 470-6090
> marcel.esser@croscon.com
>
> Before printing this e-mail, please consider the rainforest.
>