Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34833 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 70812 invoked by uid 1010); 21 Jan 2008 05:36:46 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 70797 invoked from network); 21 Jan 2008 05:36:46 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jan 2008 05:36:46 -0000 Authentication-Results: pb1.pair.com header.from=subjective@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=subjective@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.198.184 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: subjective@gmail.com X-Host-Fingerprint: 209.85.198.184 rv-out-0910.google.com Received: from [209.85.198.184] ([209.85.198.184:41789] helo=rv-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 52/28-23010-D6F24974 for ; Mon, 21 Jan 2008 00:36:46 -0500 Received: by rv-out-0910.google.com with SMTP id k15so1566444rvb.23 for ; Sun, 20 Jan 2008 21:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; bh=Uyv9tCk6Y9A2TzH6SxYrIJuBg3EGTyjPpVhzodyYIrE=; b=d1e4NN1jYukS+km7hI6IgR456+zHSO+ukgg1HTZf/NfTX86qLKuVit78Cx4OJi856GVhGaA3krjcYs/2eGNZsNELM1pRgB95WRZOaN+tccGd5k7GOThMbHktHOOH3uGROND1LJ7akR+ja/gGxGeV3EmsLBiI+E6XZ2gl+WhMssU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=YB8iJjbGCPgW51x8Cucf0BYhHiabpSqiaiekLKuD9EbcrNOiiu2cw15oyjzGytJ+6zB3APFCC848ZHPm+ukAr5pascBfxd8HDHoAVJfGSwyIjh74yScK/hcxldOkZbskpaAwbpT3u4rW3WABExSl1YweRuiJxRLWBR7j6X+lse8= Received: by 10.141.141.3 with SMTP id t3mr4178687rvn.52.1200893802720; Sun, 20 Jan 2008 21:36:42 -0800 (PST) Received: by 10.141.137.16 with HTTP; Sun, 20 Jan 2008 21:36:42 -0800 (PST) Message-ID: Date: Mon, 21 Jan 2008 16:36:42 +1100 To: "Darius Jahandarie" Cc: internals@lists.php.net In-Reply-To: <49.51.54645.E7FB2974@pb1.pair.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_4507_6217016.1200893802691" References: <47872F12.7070304@daylessday.org> <49.51.54645.E7FB2974@pb1.pair.com> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: subjective@gmail.com ("taylor luk") ------=_Part_4507_6217016.1200893802691 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline +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 ------=_Part_4507_6217016.1200893802691--