Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:35543 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 93056 invoked by uid 1010); 17 Feb 2008 18:31:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 93041 invoked from network); 17 Feb 2008 18:31:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Feb 2008 18:31:40 -0000 Authentication-Results: pb1.pair.com header.from=eric@aplosmedia.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=eric@aplosmedia.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain aplosmedia.com from 209.85.132.242 cause and error) X-PHP-List-Original-Sender: eric@aplosmedia.com X-Host-Fingerprint: 209.85.132.242 an-out-0708.google.com Received: from [209.85.132.242] ([209.85.132.242:48894] helo=an-out-0708.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id FE/10-11466-A8D78B74 for ; Sun, 17 Feb 2008 13:31:39 -0500 Received: by an-out-0708.google.com with SMTP id c18so297535anc.1 for ; Sun, 17 Feb 2008 10:31:36 -0800 (PST) Received: by 10.100.209.11 with SMTP id h11mr9343763ang.41.1203273096505; Sun, 17 Feb 2008 10:31:36 -0800 (PST) Received: from ?10.1.1.2? ( [76.180.171.218]) by mx.google.com with ESMTPS id y56sm8957801hsb.6.2008.02.17.10.31.34 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 17 Feb 2008 10:31:35 -0800 (PST) Message-ID: <1DDF0573-DF17-4F61-888C-A7AB2B203461@aplosmedia.com> To: PHPdev In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v919.2) Date: Sun, 17 Feb 2008 13:31:32 -0500 References: <47872F12.7070304@daylessday.org> <49.51.54645.E7FB2974@pb1.pair.com> X-Mailer: Apple Mail (2.919.2) Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: eric@aplosmedia.com (Eric Coleman) +1 I hope this didn't die; As a developer, I really like to use this syntax, and find it preferably from working with javascript, ruby, python, etc. Regards, Eric On Jan 21, 2008, at 12:36 AM, taylor luk wrote: > +1 > > firstly, square brackets are natural short cut to array(...) that > you can > find in many many language, one may argue this is merely a minor > addition. > however, PHP is already a very verbose compare to other language, > syntactic > improvements adds up it allows us to create much more readable code. > > someone raise up the readability issue of nested array, this is not a > language issue, but rather programming style issue. its up to you to > make it > clean or verbose as you want it to be. yes, associative array may > can look > awkward. [] is just a short cut, there is nothing stopping you mix and > match. > > $lists = array( > 'first' => [ 1, 2 ,3, 4 ] , > 'second' => [ 45, 33, 19 ] > ); > > Lastly, one may again argue this will introduce extra workload for > tester, > commiter, patchers. This is a new addition to the language, there is > no > Backward compatibility issue. This isn't a technical issue, but rather > management issue. > > PHP On the language design level hasn't been making much progress, > PHP needs > to move forward. proper closure, GC, and this. > > > On Jan 20, 2008 2:26 PM, Darius Jahandarie > wrote: > >> Antony Dovgal wrote: >>> On 10.01.2008 13:07, Ryusuke SEKIYAMA wrote: >>>> Hello, lists, >>>> >>>> I'm tired to type "array()" many times. >>> >>> -1 >>> >>> The parser in my head is unable to parse this: >>> >> $var=["str"]; >>> $var["str"]=1; >>> ?> >>> >> >> Eh, that would just come out as >> [ 0 => "str", >> "str" => 1 ] >> >> Not too problematic in my mind. >> +1 for square brackets. >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > Best Regards, > > Taylor luk