Re: [SPAM] Re: [PHP-DEV] Syntactic improvement to array

From: Date: Mon, 05 Feb 2007 17:29:25 +0000
Subject: Re: [SPAM] Re: [PHP-DEV] Syntactic improvement to array
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-27808@lists.php.net to get a copy of this message
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 =)

« previous php.internals (#27808) next »