# [RFC] Square brackets shortcut

- Thread: https://externals.io/message/34630
- Original archive: https://news-web.php.net/php.internals/34630
- Started by Ryusuke SEKIYAMA on 2008-01-10T10:07:36+00:00
- Messages: 29
- Page 1 of 2: messages 1 to 25 (25 per page, add `?page=N` to the URL)
- Next page: https://externals.io/message/34630.md?page=2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #34630 — Ryusuke SEKIYAMA — 2008-01-10T10:07:36+00:00

URL: https://externals.io/message/34630#34630

Hello, lists,

I'm tired to type "array()" many times. And I want to
declare arrays more easily. So I wrote the patch for
zend_language_parser.y which enables to declare arrays
with square brackets like some other languages.

Stanislav,
Sorry, I'm new in this list and I didn't know about past
discussion. As Marcus says, I'd like to ask around again.


There are three options:

 a) Commit square bracket array shortcut patch
    keys and values are separated by colons.
    ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
    e.g.
    $a = [1, 2, 3];
    $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];

 b) Commit square bracket array shortcut patch
    keys and values are separated by double arrows.
    ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
    e.g.
    $a = [1, 2, 3];
    $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];

 c) Reject and keep using `array()'.
    e.g.
    $a = array(1, 2, 3);
    $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');

These patches include the tests.

Which do you like? I like (a) the best.


Regards,


2008/1/6, Marcus Boerger <helly@php.net>:
> Hello Stanislav,
>
>   tha makesw three then already, how about we ask around again?
> Ryusuke, can you please start a new '[RFC] Square brackets shortcut' thread
> to collect opinions and pass along the patch for that?
>
> I like the anonymous function patch too. It is clean and simple. Maybe you
> want to start a second '[RFC] Anonymous functions' thread with that patch.
>
> Can you also please add tests for both?
>
> marcus
>
> Wednesday, January 2, 2008, 7:51:06 PM, you wrote:
>
> > […]
>
> > […]
>
>
>
> Best regards,
>  Marcus
>
>


-- 
/**
 * Ryusuke SEKIYAMA
 * rsky0711@gmail.com
 */

---

## #34632 — Marcus Boerger — 2008-01-10T10:19:02+00:00

URL: https://externals.io/message/34630#34632 · In reply to: #34630

Hello Ryusuke,

  I like b) !

marcus

Thursday, January 10, 2008, 11:07:36 AM, you wrote:

> Hello, lists,

> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other languages.

> Stanislav,
> Sorry, I'm new in this list and I didn't know about past
> discussion. As Marcus says, I'd like to ask around again.


> There are three options:

>  a) Commit square bracket array shortcut patch
>     keys and values are separated by colons.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];

>  b) Commit square bracket array shortcut patch
>     keys and values are separated by double arrows.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];

>  c) Reject and keep using `array()'.
>     e.g.
>     $a = array(1, 2, 3);
>     $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');

> These patches include the tests.

> Which do you like? I like (a) the best.


> Regards,


> 2008/1/6, Marcus Boerger <helly@php.net>:
> > […]


> -- 
> /**
>  * Ryusuke SEKIYAMA
>  * rsky0711@gmail.com
>  */




Best regards,
 Marcus

---

## #34638 — Saulo Vallory — 2008-01-10T13:36:37+00:00

URL: https://externals.io/message/34630#34638 · In reply to: #34632

If we are going to implement this, I think we should use the (b) syntax
since its how you define array elements today



> Hello Ryusuke,
>
>  I like b) !
>
> marcus
>
> Thursday, January 10, 2008, 11:07:36 AM, you wrote:
>
> > […]
>
> > […]
>
> > […]
>
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
>
> > […]
>
>
> > […]
> thread
> > […]
> you
> > […]
> patch.
> > […]
>
>
> > […]
>
>
>
>
> Best regards,
>  Marcus
>
> --
> 
> 
>
>


-- 
______________________________________

Saulo Vallory
descolando! - www.descolando.com.br
LegoCode - www.legocode.com.br
Neoconn Networks - www.neoconn.com
+55 21 8182-0308

---

## #34640 — Hannes Magnusson — 2008-01-10T13:56:54+00:00

URL: https://externals.io/message/34630#34640 · In reply to: #34632

So you reject scalar type hinting because it isn't type casting and
can therefor confuses newbies - but scattering seemingly random
brackets around your code (to safe 5 key strokes) is obvious to users?

Noone would confuse this with named arguments?
Why can't I do function foo([] $array) {} ?

foo([]);
$var = [];
Is this really readable?

Are you really serious about this?

-Hannes



> Hello Ryusuke,
>
>   I like b) !
>
> marcus
>
>
> Thursday, January 10, 2008, 11:07:36 AM, you wrote:
>
> > […]
>
> > […]
>
> > […]
>
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
> > […]
>
>
> > […]
>
>
> > […]
>
>
> > […]
>
>
>
>
> Best regards,
>  Marcus

---

## #34641 — Tomi Kaistila — 2008-01-10T14:12:30+00:00

URL: https://externals.io/message/34630#34641 · In reply to: #34640

Well if confusing is the goal, then yes, since this is classic Perl.

I started using PHP, instead of Perl, just so that I would not need play 
around with confusing syntax.

Tomi Kaistila
PHP Developer

On Thursday 10 January 2008 15:56:54 Hannes Magnusson wrote:
> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would confuse this with named arguments?
> Why can't I do function foo([] $array) {} ?
>
> foo([]);
> $var = [];
> Is this really readable?
>
> Are you really serious about this?
>
> -Hannes
>
> 
> > […]

---

## #34642 — Giedrius D — 2008-01-10T14:18:36+00:00

URL: https://externals.io/message/34630#34642 · In reply to: #34640

Hi,


> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
>
> Noone would confuse this with named arguments?
> Why can't I do function foo([] $array) {} ?
Can you do function foo(array() $array) {} ?

>
> foo([]);
> $var = [];
> Is this really readable?
Looks readable to me ;-)

FWIW if it's going to be implemented I think (b) should be the choice
as it is more consistent with current syntax even though I like (a)
more.

>
> Are you really serious about this?
>
> -Hannes
>
>
>
> 
> > […]
>
> --
> 
> 
>
>

Regards,
Giedrius

---

## #34643 — Sam Barrow — 2008-01-10T14:20:11+00:00

URL: https://externals.io/message/34630#34643 · In reply to: #34630

I like b.


> Hello, lists,
> 
> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other languages.
> 
> Stanislav,
> Sorry, I'm new in this list and I didn't know about past
> discussion. As Marcus says, I'd like to ask around again.
> 
> 
> There are three options:
> 
>  a) Commit square bracket array shortcut patch
>     keys and values are separated by colons.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
> 
>  b) Commit square bracket array shortcut patch
>     keys and values are separated by double arrows.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];
> 
>  c) Reject and keep using `array()'.
>     e.g.
>     $a = array(1, 2, 3);
>     $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');
> 
> These patches include the tests.
> 
> Which do you like? I like (a) the best.
> 
> 
> Regards,
> 
> 
> 2008/1/6, Marcus Boerger <helly@php.net>:
> > […]
> 
> 
> -- 
> /**
>  * Ryusuke SEKIYAMA
>  * rsky0711@gmail.com
>  */

---

## #34644 — Lukas Kahwe Smith — 2008-01-10T14:23:54+00:00

URL: https://externals.io/message/34630#34644 · In reply to: #34641

> Well if confusing is the goal, then yes, since this is classic Perl.
>
> I started using PHP, instead of Perl, just so that I would not need  
> play
> around with confusing syntax.

Right, PHP was always about making it easy to see whats going on and  
more importantly to at least be able to quickly look something up in  
the manual. Maybe the better approach would be to hide "array" inside  
the browser and magically add it if its "missing".

regards,
Lukas

---

## #34645 — Sam Barrow — 2008-01-10T14:36:31+00:00

URL: https://externals.io/message/34630#34645 · In reply to: #34642

> Hi,
> 
> 
> > […]
> Can you do function foo(array() $array) {} ?
> 
> > […]
> Looks readable to me ;-)

I really like $var = []; but I don't like foo([]) at all.

> FWIW if it's going to be implemented I think (b) should be the choice
> as it is more consistent with current syntax even though I like (a)
> more.
> 
> > […]
> 
> Regards,
> Giedrius

---

## #34646 — Sam Barrow — 2008-01-10T14:37:47+00:00

URL: https://externals.io/message/34630#34646 · In reply to: #34630

I just tried this out using option b, and I really like it.

$var = [1, 6, 434] ;

I think it looks good and helps code readability alot.


> Hello, lists,
> 
> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other languages.
> 
> Stanislav,
> Sorry, I'm new in this list and I didn't know about past
> discussion. As Marcus says, I'd like to ask around again.
> 
> 
> There are three options:
> 
>  a) Commit square bracket array shortcut patch
>     keys and values are separated by colons.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
> 
>  b) Commit square bracket array shortcut patch
>     keys and values are separated by double arrows.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];
> 
>  c) Reject and keep using `array()'.
>     e.g.
>     $a = array(1, 2, 3);
>     $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');
> 
> These patches include the tests.
> 
> Which do you like? I like (a) the best.
> 
> 
> Regards,
> 
> 
> 2008/1/6, Marcus Boerger <helly@php.net>:
> > […]
> 
> 
> -- 
> /**
>  * Ryusuke SEKIYAMA
>  * rsky0711@gmail.com
>  */

---

## #34647 — Sam Barrow — 2008-01-10T14:39:28+00:00

URL: https://externals.io/message/34630#34647 · In reply to: #34640

> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
> 
> Noone would confuse this with named arguments?
> Why can't I do function foo([] $array) {} ?
> 
> foo([]);
> $var = [];
> Is this really readable?
> 
> Are you really serious about this?

I don't think the only benefit in this would be to save keystrokes. I
think it looks better, and makes code more readable, whereas the current
way just looks like a function call.

> -Hannes
> 
> 
> 
> > […]

---

## #34648 — Hannes Magnusson — 2008-01-10T14:49:05+00:00

URL: https://externals.io/message/34630#34648 · In reply to: #34646

Did you know that you don't have to reply multiple times to the same post?
And even though Stas replies to every single post, you don't have to do it too.


Please read Andis "checklist" again;
http://news.php.net/php.internals/34494 - same "rules" apply to all
threads.

-Hannes


> I just tried this out using option b, and I really like it.
>
> $var = [1, 6, 434] ;
>
> I think it looks good and helps code readability alot.
>
> 
>
> > […]

---

## #34649 — Daniel Brown — 2008-01-10T15:04:17+00:00

URL: https://externals.io/message/34630#34649 · In reply to: #34647

> 
> > […]
>
> I don't think the only benefit in this would be to save keystrokes. I
> think it looks better, and makes code more readable, whereas the current
> way just looks like a function call.

    Not only do I agree, but I'll also refer anyone wondering how well
it would really be adopted due to the initial difficulty in
recognizing the structure to the ternary operator.  Unless it's an
obvious condition and result, ternary operation itself is equally - if
not more - trivial to initially figure out than $a = [1,2,3];.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since 1979.

---

## #34660 — Andi Gutmans — 2008-01-10T19:36:22+00:00

URL: https://externals.io/message/34630#34660 · In reply to: #34630

I recommended (b) a few months back and got shot down :)
I still like it :)

Andi

> -----Original Message-----
> From: Ryusuke SEKIYAMA [mailto:rsky0711@gmail.com]
> Sent: Thursday, January 10, 2008 2:08 AM
> To: internals@lists.php.net
> Cc: Marcus Boerger; Stas Malyshev
> Subject: [PHP-DEV] [RFC] Square brackets shortcut
> 
> Hello, lists,
> 
> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other languages.
> 
> Stanislav,
> Sorry, I'm new in this list and I didn't know about past
> discussion. As Marcus says, I'd like to ask around again.
> 
> 
> There are three options:
> 
>  a) Commit square bracket array shortcut patch
>     keys and values are separated by colons.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
> 
>  b) Commit square bracket array shortcut patch
>     keys and values are separated by double arrows.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];
> 
>  c) Reject and keep using `array()'.
>     e.g.
>     $a = array(1, 2, 3);
>     $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');
> 
> These patches include the tests.
> 
> Which do you like? I like (a) the best.
> 
> 
> Regards,
> 
> 
> 2008/1/6, Marcus Boerger <helly@php.net>:
> > […]
> thread
> > […]
> Maybe you
> > […]
> patch.
> > […]
> then
> > […]
> 
> 
> --
> /**
>  * Ryusuke SEKIYAMA
>  * rsky0711@gmail.com
>  */

---

## #34661 — Andi Gutmans — 2008-01-10T19:40:35+00:00

URL: https://externals.io/message/34630#34661 · In reply to: #34648

I think next time Sam has three consecutive responses to the same thread
then he loses access to the list for a week :) (same rule for anyone
else). Tweaking the 'Subject' won't count as a different thread :)

Andi

> -----Original Message-----
> From: Hannes Magnusson [mailto:hannes.magnusson@gmail.com]
> Sent: Thursday, January 10, 2008 6:49 AM
> To: Sam Barrow
> Cc: PHP Development
> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut
> 
> Did you know that you don't have to reply multiple times to the same
> post?
> And even though Stas replies to every single post, you don't have to
do
> it too.
> 
> 
> Please read Andis "checklist" again;
> http://news.php.net/php.internals/34494 - same "rules" apply to all
> threads.
> 
> -Hannes
> 
> 
> > […]
> 'lemon');
> > […]
> shortcut' thread
> > […]
> Maybe you
> > […]
> that patch.
> > […]
> (even
> > […]
objected
> then
> > […]

---

## #34662 — Pierre — 2008-01-10T19:46:55+00:00

URL: https://externals.io/message/34630#34662 · In reply to: #34630

Hi,



>  b) Commit square bracket array shortcut patch
>     keys and values are separated by double arrows.
>     ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>     e.g.
>     $a = [1, 2, 3];
>     $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];

I like this one, +1

ps: no need to argue why you don't like, it would be nice to simply
say +1/-1, trolls quota is already full for this year :)

-- 
Pierre
http://blog.thepimp.net | http://www.libgd.org

---

## #34664 — Derick Rethans — 2008-01-10T20:09:33+00:00

URL: https://externals.io/message/34630#34664 · In reply to: #34640

> So you reject scalar type hinting because it isn't type casting and
> can therefor confuses newbies - but scattering seemingly random
> brackets around your code (to safe 5 key strokes) is obvious to users?
> 
> Noone would confuse this with named arguments?
> Why can't I do function foo([] $array) {} ?
> 
> foo([]);
> $var = [];
> Is this really readable?
> 
> Are you really serious about this?

I have to agree with this. It looks all cool and nice and stolen from 
another language. But in the long end, all this does is saving you 5 
chars to type, and lose a hell of a lot readability in the meanwhile.

(In case it's not obvious: -1)

regards,
Derick

---

## #34667 — David Coallier — 2008-01-10T23:21:37+00:00

URL: https://externals.io/message/34630#34667 · In reply to: #34661

> I think next time Sam has three consecutive responses to the same thread
> then he loses access to the list for a week :) (same rule for anyone
> else). Tweaking the 'Subject' won't count as a different thread :)
>
> Andi
>
>
> > […]
> do
> > […]
> objected
> > […]
>
> --
>
> 
> 
>
>

If you want reasons just ask me privately, as Pierre said, no need to argue :)
-1


D

---

## #34673 — Larry Garfield — 2008-01-11T01:18:10+00:00

URL: https://externals.io/message/34630#34673 · In reply to: #34641

> Well if confusing is the goal, then yes, since this is classic Perl.
>
> I started using PHP, instead of Perl, just so that I would not need play
> around with confusing syntax.
>
> Tomi Kaistila
> PHP Developer

The [] array literal syntax is also used by Javascript, and there's even an 
object literal syntax, {}, which is quite nice.  Does that mean "Javascript 
is classic Perl"?

The [a:b, c:d] syntax would be more JSON-esque, while [a => b] syntax would be 
more consistent with existing PHP.  The latter, I think, would get better 
traction with existing developers and be easier to understand (since it uses 
the same separator character).

-- 
Larry Garfield			AIM: LOLG42
larry@garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson

---

## #34677 — Tomi Kaistila — 2008-01-11T06:15:26+00:00

URL: https://externals.io/message/34630#34677 · In reply to: #34673

> The [] array literal syntax is also used by Javascript, and there's even an
> object literal syntax, {}, which is quite nice.  Does that mean "Javascript
> is classic Perl"?
Yes, the first thing that comes to mind from this syntax is Perl.

(1, 2, 3, 4, 5)
("dharma", "wilma", "greg", "mina")
qw{ wilhelm yaztsee ben madonna }
qw! wilhelm yaztsee ben madonna !
qw[ wilhelm yaztsee ben madonna ]

Does this look familiar? Javascript is not classic Perl but the proposed way 
of assign array values is.

> The [a:b, c:d] syntax would be more JSON-esque, while [a => b] syntax would
> be more consistent with existing PHP.  The latter, I think, would get
> better traction with existing developers and be easier to understand (since
> it uses the same separator character).
If this is implemented, I would agree that sticking as close to the old syntax 
as possible is the best approach.

I would go with the choice B except instead of square brackets use round 
brackets.

$a = (1, 2, 3, 4, 5);
$a = (1 => 'dharma', 2 => 'wilma');

This would be consistent with the old way of assigning array values and will 
probably least confuse both new and old developers.

Tomi Kaistila
PHP Developer

---

## #34687 — Antony Dovgal — 2008-01-11T08:55:46+00:00

URL: https://externals.io/message/34630#34687 · In reply to: #34630

> Hello, lists,
> 
> I'm tired to type "array()" many times. 

-1

The parser in my head is unable to parse this:
<?php
$var=["str"];
$var["str"]=1;
?>

-- 
Wbr, 
Antony Dovgal

---

## #34691 — Jani Taskinen — 2008-01-11T10:02:51+00:00

URL: https://externals.io/message/34630#34691 · In reply to: #34660

I don't remember ever seeing this before, but I'm still very strongly
against this kind of useless syntax sugar..

--Jani



> I recommended (b) a few months back and got shot down :)
> I still like it :)
> 
> Andi
> 
> > […]
> 
-- 
Patches/Donations: http://pecl.php.net/~jani/

---

## #34724 — Geoffrey Sneddon — 2008-01-11T14:17:49+00:00

URL: https://externals.io/message/34630#34724 · In reply to: #34630

> I'm tired to type "array()" many times. And I want to
> declare arrays more easily. So I wrote the patch for
> zend_language_parser.y which enables to declare arrays
> with square brackets like some other languages.

I don't think tiredness to type an extra five characters should be an  
excuse to change the syntax. There are language specifically designed  
to require the minimum number of characters to be typed — if this is a  
real concern, you'd be better off using one of them and not PHP.

> There are three options:
>
> a) Commit square bracket array shortcut patch
>    keys and values are separated by colons.
>    ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch )
>    e.g.
>    $a = [1, 2, 3];
>    $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];

Breaks from PHP's => for no apparent reason (one character too many  
character this time?), which is just confusing (that's an implicit -1).

> b) Commit square bracket array shortcut patch
>    keys and values are separated by double arrows.
>    ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch )
>    e.g.
>    $a = [1, 2, 3];
>    $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];

Breaks backwards compatibility to save typing five characters. See  
above. -1.

> c) Reject and keep using `array()'.
>    e.g.
>    $a = array(1, 2, 3);
>    $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon');

For all the above reasons, +1.



--
Geoffrey Sneddon
<http://gsnedders.com/

---

## #34725 — Mark Dennehy — 2008-01-11T14:28:51+00:00

URL: https://externals.io/message/34630#34725 · In reply to: #34724

> I don't think tiredness to type an extra five characters should be an
> excuse to change the syntax.


No, but clarity of expression is a valid reason to do so.


> > […]
> Breaks from PHP's => for no apparent reason (one character too many
> character this time?), which is just confusing (that's an implicit -1).


Agreed;


> > […]
> Breaks backwards compatibility to save typing five characters. See
> above. -1.
>

It doesn't break backwards compatibility; the new syntax is an alias, not a
replacement. The older array() syntax will still be in place, if I've
understood the earlier posts correctly.

-- 
Mark Dennehy

---

## #34728 — Geoffrey Sneddon — 2008-01-11T14:39:10+00:00

URL: https://externals.io/message/34630#34728 · In reply to: #34725

> > […]
>
> It doesn't break backwards compatibility; the new syntax is an  
> alias, not a
> replacement. The older array() syntax will still be in place, if I've
> understood the earlier posts correctly.

Maybe I did not express myself well enough: this introduces a new  
syntax for something that isn't broken that doesn't work on existing  
PHP versions.


--
Geoffrey Sneddon
<http://gsnedders.com/

---

Next page: https://externals.io/message/34630.md?page=2
