Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5241 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25523 invoked by uid 1010); 5 Nov 2003 17:19:19 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 25484 invoked from network); 5 Nov 2003 17:19:18 -0000 Received: from unknown (HELO asuka.nerv) (24.112.18.98) by pb1.pair.com with SMTP; 5 Nov 2003 17:19:18 -0000 Received: (qmail 13440 invoked from network); 5 Nov 2003 17:24:58 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 5 Nov 2003 17:24:58 -0000 Reply-To: ilia@prohost.org To: "Ford, Mike [LSS]" , internals@lists.php.net Date: Wed, 5 Nov 2003 12:25:57 -0500 User-Agent: KMail/1.5.4 References: <841D90E489448A4F804E1D1B95768BF7D4626B@lis-exchange3.lmu.ac.uk> In-Reply-To: <841D90E489448A4F804E1D1B95768BF7D4626B@lis-exchange3.lmu.ac.uk> Organization: Prohost.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200311051225.57116.ilia@prohost.org> Subject: Re: [PHP-DEV] Proposal: Array syntax From: ilia@prohost.org (Ilia Alshanetsky) 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