Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34648 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20069 invoked by uid 1010); 10 Jan 2008 14:49:16 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20054 invoked from network); 10 Jan 2008 14:49:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2008 14:49:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=hannes.magnusson@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=hannes.magnusson@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.92.173 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: hannes.magnusson@gmail.com X-Host-Fingerprint: 66.249.92.173 ug-out-1314.google.com Received: from [66.249.92.173] ([66.249.92.173:40699] helo=ug-out-1314.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AA/97-59671-B6036874 for ; Thu, 10 Jan 2008 09:49:15 -0500 Received: by ug-out-1314.google.com with SMTP id u40so243152ugc.29 for ; Thu, 10 Jan 2008 06:49:12 -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:content-transfer-encoding:content-disposition:references; bh=CuELUQWOJgCBjsT4jJjpI2yTBPfIeHdyJjoZDqfLYp4=; b=Kln2/WmsaarhcxIFg1TFlLmEXEAqXWkULUvkuQddSmg21eZF/IsBGE5BUgVc6IuLfF4v1G5WsPbk4ia6tuVxSC0i9n2dr3NrcIpw7hsmB2EPPeKZHaiFXcZq3hqF1qYu+s9JIpgpdijcRivy6Gx0nQUg8S2a80YXLtjxllsdxbc= 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:content-transfer-encoding:content-disposition:references; b=fs7uivDXKBReuibGja+AsQd77pYCX1lD36oKZ0gl4DTSYF70i4aucaJGnXSGk87WUQB3PcHlwzwmHEWIRLuDYju3V1ilRM6n4KGMZKrbCeer711eNcnFofrHzrEljb3sGYLwnyoOYNhBc/OiUh9hYpsheCerrp6qrnk5opkEGIk= Received: by 10.142.84.3 with SMTP id h3mr1004785wfb.34.1199976545959; Thu, 10 Jan 2008 06:49:05 -0800 (PST) Received: by 10.142.192.6 with HTTP; Thu, 10 Jan 2008 06:49:05 -0800 (PST) Message-ID: <7f3ed2c30801100649t2eb9f69dj5d2009702a5bb9ec@mail.gmail.com> Date: Thu, 10 Jan 2008 15:49:05 +0100 To: "Sam Barrow" Cc: "PHP Development" In-Reply-To: <1199975867.25972.5.camel@sbarrow-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1199975867.25972.5.camel@sbarrow-desktop> Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: hannes.magnusson@gmail.com ("Hannes Magnusson") Did you know that you don't have to reply multiple times to the same post? And even though Stas replies to every single post, you don't have to do it too. Please read Andis "checklist" again; http://news.php.net/php.internals/34494 - same "rules" apply to all threads. -Hannes On Jan 10, 2008 3:37 PM, Sam Barrow wrote: > I just tried this out using option b, and I really like it. > > $var = [1, 6, 434] ; > > I think it looks good and helps code readability alot. > > On Thu, 2008-01-10 at 19:07 +0900, Ryusuke SEKIYAMA wrote: > > > Hello, lists, > > > > I'm tired to type "array()" many times. And I want to > > declare arrays more easily. So I wrote the patch for > > zend_language_parser.y which enables to declare arrays > > with square brackets like some other languages. > > > > Stanislav, > > Sorry, I'm new in this list and I didn't know about past > > discussion. As Marcus says, I'd like to ask around again. > > > > > > There are three options: > > > > a) Commit square bracket array shortcut patch > > keys and values are separated by colons. > > ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch ) > > e.g. > > $a = [1, 2, 3]; > > $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon']; > > > > b) Commit square bracket array shortcut patch > > keys and values are separated by double arrows. > > ( http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch ) > > e.g. > > $a = [1, 2, 3]; > > $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon']; > > > > c) Reject and keep using `array()'. > > e.g. > > $a = array(1, 2, 3); > > $b = array('foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'); > > > > These patches include the tests. > > > > Which do you like? I like (a) the best. > > > > > > Regards, > > > > > > 2008/1/6, Marcus Boerger : > > > Hello Stanislav, > > > > > > tha makesw three then already, how about we ask around again? > > > Ryusuke, can you please start a new '[RFC] Square brackets shortcut' thread > > > to collect opinions and pass along the patch for that? > > > > > > I like the anonymous function patch too. It is clean and simple. Maybe you > > > want to start a second '[RFC] Anonymous functions' thread with that patch. > > > > > > Can you also please add tests for both? > > > > > > marcus > > > > > > Wednesday, January 2, 2008, 7:51:06 PM, you wrote: > > > > > > >> the square bracket array syntax patch for PHP 5.3, > > > >> http://www.opendogs.org/pub/php-5.3dev-080101-sbar.patch > > > > > > > I remember we discussed that already and it was rejected then (even > > > > though myself and Andi liked it) - did the people that objected then > > > > change their minds? > > > > > > > > > > > > Best regards, > > > Marcus > > > > > > > > > > > > -- > > /** > > * Ryusuke SEKIYAMA > > * rsky0711@gmail.com > > */ > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >