atom feed88 messages in net.php.lists.internalsRe: [PHP-DEV] Proposal: Array syntax
FromSent OnAttachments
21 earlier messages
Ilia AlshanetskyNov 5, 2003 7:56 am 
Antony DovgalNov 5, 2003 8:03 am 
Rasmus LerdorfNov 5, 2003 8:21 am 
Christian SchneiderNov 5, 2003 8:30 am 
Andrey HristovNov 5, 2003 8:40 am 
Ilia AlshanetskyNov 5, 2003 8:47 am 
Andi GutmansNov 5, 2003 8:47 am 
Jani TaskinenNov 5, 2003 8:49 am 
Ford, Mike [LSS]Nov 5, 2003 8:50 am 
Marco TabiniNov 5, 2003 8:52 am 
Christian SchneiderNov 5, 2003 8:54 am 
George SchlossnagleNov 5, 2003 8:58 am 
Jani TaskinenNov 5, 2003 8:59 am 
Christian SchneiderNov 5, 2003 9:00 am 
Ford, Mike [LSS]Nov 5, 2003 9:00 am 
Marco TabiniNov 5, 2003 9:01 am 
Marco TabiniNov 5, 2003 9:05 am 
Ford, Mike [LSS]Nov 5, 2003 9:07 am 
Ford, Mike [LSS]Nov 5, 2003 9:09 am 
Marco TabiniNov 5, 2003 9:18 am 
Romans MalinovskisNov 5, 2003 9:19 am 
Andi GutmansNov 5, 2003 9:20 am 
StephNov 5, 2003 9:25 am 
Andrey HristovNov 5, 2003 9:25 am 
Ilia AlshanetskyNov 5, 2003 9:25 am 
Marco TabiniNov 5, 2003 9:30 am 
Derick RethansNov 5, 2003 9:33 am 
George SchlossnagleNov 5, 2003 9:36 am 
Rasmus LerdorfNov 5, 2003 9:45 am 
Edin KadribasicNov 5, 2003 9:45 am 
Romans MalinovskisNov 5, 2003 9:48 am 
Moriyoshi KoizumiNov 5, 2003 9:50 am 
Jani TaskinenNov 5, 2003 9:54 am 
Jaap van GanswijkNov 5, 2003 10:06 am 
Michael WalterNov 5, 2003 10:12 am 
Cesare D'AmicoNov 5, 2003 10:22 am 
Marco TabiniNov 5, 2003 10:28 am 
Michael WalterNov 5, 2003 10:30 am 
Michael WalterNov 5, 2003 10:35 am 
George SchlossnagleNov 5, 2003 10:36 am 
Andrei ZmievskiNov 5, 2003 10:39 am 
George SchlossnagleNov 5, 2003 10:56 am 
David EndersonNov 5, 2003 11:02 am 
Marco TabiniNov 5, 2003 11:10 am 
Shane CaraveoNov 5, 2003 11:12 am 
Michael WalterNov 5, 2003 12:26 pm 
Greg MacLellanNov 5, 2003 12:40 pm 
Robert CummingsNov 5, 2003 1:08 pm 
David EndersonNov 5, 2003 1:19 pm 
Sara GolemonNov 5, 2003 2:40 pm 
17 later messages
Subject:Re: [PHP-DEV] Proposal: Array syntax
From:Ilia Alshanetsky (il@prohost.org)
Date:Nov 5, 2003 9:25:35 am
List:net.php.lists.internals

On November 5, 2003 12:01 pm, Ford, Mike [LSS] wrote:

I don't think the number of characters is the main issue here -- it's about having a *nicer* set of characters. Personally, I'd be still be in favour (although not quite as much) if the proposed syntax were [[[1,2,3]]] -- for me, it's about having a syntax that shouts *ARRAY* rather than whispers it. (Although the reduction in characters is handy -- particularly in a construct like ['foo' => ['bar'=>'on', 'baz'=>[2,3,5,7]], 'bedrock'=>['rubble'=>['barney', 'betty'], 'flintstone'=>['fred', 'wilma']]].)

Sure, now support one of your string array keys/values contains a [ or ] character. That would wreak havoc with the readability of the code.

Having 2 separate syntaxes would mean that some devs would use one format and the other another. And eventually you'll end up with the same code written in 2 separate ways within the same script/application because 1 part (older?) was written in 1 way and the other (newer) written in another. This makes the entire application more difficult to understand and since many people learn through modifying scripts you'll create more barriers to entry for new users.

A few more examples how this will cause problems:

$a[1,2,3,4][] = [5,6,7,8][2];

Ilia