Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:27808 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65366 invoked by uid 1010); 5 Feb 2007 17:29:30 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65351 invoked from network); 5 Feb 2007 17:29:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Feb 2007 17:29:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=brianm@dealnews.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=brianm@dealnews.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain dealnews.com designates 129.41.69.185 as permitted sender) X-PHP-List-Original-Sender: brianm@dealnews.com X-Host-Fingerprint: 129.41.69.185 smtp.dealnews.com Linux 2.5 (sometimes 2.4) (4) Received: from [129.41.69.185] ([129.41.69.185:55382] helo=smtp.dealnews.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1D/8E-61367-87967C54 for ; Mon, 05 Feb 2007 12:29:29 -0500 Received: (qmail 20321 invoked from network); 5 Feb 2007 12:29:26 -0500 Received: from unknown (HELO ?10.1.6.4?) (10.1.6.4) by -H with SMTP; 5 Feb 2007 12:29:26 -0500 Message-ID: <45C76975.9010704@dealnews.com> Date: Mon, 05 Feb 2007 11:29:25 -0600 User-Agent: Thunderbird 2.0b2 (Macintosh/20070116) MIME-Version: 1.0 To: "Ford, Mike" CC: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [SPAM] Re: [PHP-DEV] Syntactic improvement to array From: brianm@dealnews.com (Brian Moon) Ford, Mike wrote: >> I don't find: >> >> $a = [1 => ['pears', 'apples'], 2 => ['juice', 'oranges']]; >> >> any less readable than: >> >> $a = array(1 => array('pears', 'apples'), 2 => array('juice', >> 'oranges')); >> >> Quite the opposite actually :) > > Me too - I go beyond Edin on this one, as I find the array() version actually quite UNreadable and I have difficulty picking out what the individual arrays are; conversely, the [] version I take in at a glance. That is why you have coding standards. Our doucment states that this should be written as: $a = array( 1 => array('pears', 'apples'), 2 => array('juice', 'oranges') ); I believe in either syntax, proper formatting of complex data can solve the readablity problems. -- Brian Moon ------------- http://dealnews.com/ It's good to be cheap =)