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

From: Date: Mon, 05 Feb 2007 11:29:52 +0000
Subject: RE: [PHP-DEV] [SPAM] Re: [PHP-DEV] Syntactic improvement to array
Groups: php.internals 
Request: Send a blank email to internals+get-27803@lists.php.net to get a copy of this message
On 04 February 2007 18:38, Edin Kadribasic wrote: > Lukas Kahwe Smith wrote: > > Yes, you will come across it if its added. > > I find the Javascript syntax confusing to read as well. However more > > importantly I do not see the point in adding this sugar to save 5 > > chars. > > Nested arrays become very unreadable with the current PHP syntax. I > think killing those 5 chars per array would actually make thing more > readable. > > > 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. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: m.ford@leedsmet.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

« previous php.internals (#27803) next »