Re: Bug #13846 Updated: Patch: Use [ ] as shortcut forarray()
| From: | Jeroen van Wolffelaar | Date: | Sun, 28 Oct 2001 19:02:10 +0000 |
| Subject: | Re: Bug #13846 Updated: Patch: Use [ ] as shortcut forarray() | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-69208@lists.php.net to get a copy of this message | ||
> >On Sun, 28 Oct 2001, Zakaria wrote:
> >
> >>For example:
> >> Perl: $list = (1, 2 ,3, 'four', 'five', (6.1, 6.2, 6.3));
> >>Python: list = [1, 2, 3, 'four', 'five', [6.1, 6.2, 6.3]]
> >> Ruby: list = [1, 2, 3, 'four', 'five', [6.1, 6.2, 6.3]]
> >> Tcl: set list {1 2 3 four five {6.1 6.2 6.3}}
> >>
> >> PHP: $list = array(1, 2, 3, 'four', 'five', array(6.1, 6.2,
> >> 6.3));
> >
> >Which clearly shows that PHP is readable and all the other languages are
> >not. -10 from me to this feature.
And these example are still a bit readable, but what about:
$arr1 = [];
$arr2[10] = [2];
$foo = bla('arg1', [2, 3, 4]);
and such cases...
So indeed a bad idea.
--Jeroen