Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:37959 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89317 invoked from network); 28 May 2008 10:01:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 May 2008 10:01:26 -0000 Received: from [127.0.0.1] ([127.0.0.1:16917]) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ECSTREAM id 15/0C-15519-57D2D384 for ; Wed, 28 May 2008 06:01:25 -0400 Authentication-Results: pb1.pair.com header.from=dz@bitextender.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dz@bitextender.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain bitextender.com from 80.237.132.12 cause and error) X-PHP-List-Original-Sender: dz@bitextender.com X-Host-Fingerprint: 80.237.132.12 wp005.webpack.hosteurope.de Received: from [80.237.132.12] ([80.237.132.12:37881] helo=wp005.webpack.hosteurope.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/BB-15519-40C2D384 for ; Wed, 28 May 2008 05:55:18 -0400 Received: from dslb-088-066-163-191.pools.arcor-ip.net ([88.66.163.191] helo=[192.168.0.103]); authenticated by wp005.webpack.hosteurope.de running ExIM using esmtpsa (TLSv1:RC4-SHA:128) id 1K1ING-0006Vm-8j; Wed, 28 May 2008 11:55:14 +0200 Cc: internals@lists.php.net Message-ID: To: Sebastian Deutsch In-Reply-To: <97.F8.15519.1229C384@pb1.pair.com> 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: Wed, 28 May 2008 11:55:13 +0200 References: <0412F6FE505049F7901EAB8C61774839@pc> <87.77.15519.9E47C384@pb1.pair.com> <97.F8.15519.1229C384@pb1.pair.com> X-Mailer: Apple Mail (2.919.2) X-bounce-key: webpack.hosteurope.de;dz@bitextender.com;1211968517;c8d4d373; Subject: Re: [PHP-DEV] Re: Short syntax for array literals [...] From: dz@bitextender.com (=?ISO-8859-1?Q?David_Z=FClke?=) -1. (the syntax with colons is appalling, and the other one doesn't look any more readable - and is not javascript-ish either, since JS arrays can only have numeric keys. I'd welcome the syntax without any chance of specifying keys, but then, that'd be a really half-arsed solution) Am 28.05.2008 um 00:58 schrieb Sebastian Deutsch: > fyi - i added a RFC > > http://wiki.php.net/rfc/shortsyntaxforarrays > > please add your votes > > cheers > > Sebastian > > Sebastian Deutsch schrieb: >> dont have karma - but I would love it! so +1 here. >> would it make sense to write an RFC? >> cheers >> Sebastian >> Stan Vassilev | FM schrieb: >>> Hi, >>> >>> I hear this often by other developers and I tend to agree with >>> them, that arrays are used often, and often nested, so that having >>> a long syntax for array literals tend to produce less legible code >>> than in other scriping languages. >>> >>> $a = array(array(1,2), array(3,4), 5, 6); >>> >>> $b = array('a' => 1, 'b' =>2); >>> >>> We use arrays in our configurations, in passing complex parameters >>> to functions, fetching information from databases, basically >>> everything. So it adds up. >>> >>> Some frameworks have somewhat funny attempts to remedy this by >>> introducing "shortcuts" like this: function a() { return >>> func_get-args(); }. Of course this doesn't work when you need to >>> specify the key name, and the overhead isn't worth it. >>> >>> It looks as there may not be a specific reason not to allow the JS >>> syntax as an alternative syntax (while keeping the current one in >>> parallel): >>> >>> $a = [[1, 2], [3, 4], 5, 6]; >>> >>> $b = ['a' => 1, 'b' =>2]; >>> >>> There shouldn't be confusion to the parser as the brackets aren't >>> preceded by an identifier. >>> >>> Was this discussed before on the list? >>> >>> Regards, Stan Vassilev > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >