On Sun, 2007-02-04 at 19:38 +0100, Edin Kadribasic wrote:
> Lukas Kahwe Smith wrote:
> > Yes, you will come across it if its added.
> > I find the Javascript syntax confusing to read as well. However more
> > importantly I do not see the point in adding this sugar to save 5 chars.
>
> Nested arrays become very unreadable with the current PHP syntax. I
> think killing those 5 chars per array would actually make thing more
> readable.
>
>
> I don't find:
>
> $a = [1 => ['pears', 'apples'], 2 => ['juice', 'oranges']];
>
> any less readable than:
>
> $a = array(1 => array('pears', 'apples'), 2 => array('juice', 'oranges'));
>
> Quite the opposite actually :)
Depends on how you format multi-level arrays...
$a = array
(
1 => array
(
'pears',
'apples',
),
2 => array
(
'juice',
'organge',
),
);
In the new format...
$a =
[
1 =>
[
'pears',
'apples',
],
2 =>
[
'juice',
'organge',
],
];
Can't say that I see a terribly great advantage in readability.
-0 :)
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php