Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5240 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23704 invoked by uid 1010); 5 Nov 2003 17:18:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 23641 invoked from network); 5 Nov 2003 17:18:21 -0000 Received: from unknown (HELO tabini.ca) (198.63.211.18) by pb1.pair.com with SMTP; 5 Nov 2003 17:18:21 -0000 Received: from cpe0080c80c4893-cm013439900542.cpe.net.cable.rogers.com ([24.156.158.54] helo=tabini.ca) by tabini.ca with asmtp (TLSv1:AES256-SHA:256) (Exim 4.22) id 1AHRLB-0003vy-4t; Wed, 05 Nov 2003 11:21:09 -0600 Message-ID: <3FA930E7.4030405@tabini.ca> Date: Wed, 05 Nov 2003 12:18:31 -0500 Organization: Marco Tabini & Associates, Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031023 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "Ford, Mike [LSS]" CC: internals@lists.php.net References: <841D90E489448A4F804E1D1B95768BF7D4626D@lis-exchange3.lmu.ac.uk> In-Reply-To: <841D90E489448A4F804E1D1B95768BF7D4626D@lis-exchange3.lmu.ac.uk> X-Enigmail-Version: 0.81.6.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Proposal: Array syntax From: marcot@tabini.ca (Marco Tabini) Ford, Mike [LSS] wrote: > On 05 November 2003 17:06, Marco Tabini contributed these pearls of wisdom: > > >>Christian Schneider wrote: >> >>>Marco Tabini wrote: >>> >>> >>>>$a = [[1,2,3],[1=>[1,3,2,2], "a"=>[[1,2,3,4],4,[1,2]]]; >>> >>> >>>$a = array(array(1,2,3),array(1=>array(1,3,2,2), >>>"a"=>array(array(1,2,3,4),4,array(1,2))); >>> >> >>Besides my previous points, something even more abominable: >> >>$a = [1,2,$b[11]]; >> >>Is that confusing enough for you? ;-) > > > What's confusing about it? > The fact that $b[11] references an item of an array, while [1,2,$b[11]] assigns values to the array $a. The fact that you (and, probably, most of us) can't tell right off the bat is a clear sign that this is a bad idea, because it's ambiguous and confusing. The same line using the current syntax, btw, would have looked like this: $a = array (1,3,$b[11]); As you can see the ambiguity is gone--square brackets are used for one purpose and nothing else. Cheers, Marco