Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34691 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14303 invoked by uid 1010); 11 Jan 2008 10:02:56 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 14288 invoked from network); 11 Jan 2008 10:02:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Jan 2008 10:02:56 -0000 Authentication-Results: pb1.pair.com header.from=jani.taskinen@sci.fi; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jani.taskinen@sci.fi; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain sci.fi from 63.208.196.179 cause and error) X-PHP-List-Original-Sender: jani.taskinen@sci.fi X-Host-Fingerprint: 63.208.196.179 mho-02-bos.mailhop.org Received: from [63.208.196.179] ([63.208.196.179:61383] helo=mho-02-bos.mailhop.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2D/65-51656-FCE37874 for ; Fri, 11 Jan 2008 05:02:55 -0500 Received: from [81.22.163.71] (helo=[10.6.109.198]) by mho-02-bos.mailhop.org with esmtpsa (SSLv3:RC4-MD5:128) (Exim 4.68) (envelope-from ) id 1JDGiz-0002u6-P2; Fri, 11 Jan 2008 10:02:54 +0000 X-Mail-Handler: MailHop Outbound by DynDNS X-Originating-IP: 81.22.163.71 X-Report-Abuse-To: abuse@dyndns.com (see http://www.mailhop.org/outbound/abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX19D6RAhAF301kqJESkcHnTGVid8CWUeDAQ= Reply-To: jani.taskinen@iki.fi To: Andi Gutmans Cc: internals@lists.php.net In-Reply-To: <698DE66518E7CA45812BD18E807866CE011C7B84@us-ex1.zend.net> References: <698DE66518E7CA45812BD18E807866CE011C7B84@us-ex1.zend.net> Content-Type: text/plain Date: Fri, 11 Jan 2008 12:02:51 +0200 Message-ID: <1200045771.18332.0.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.3 (2.8.3-2.fc6) Content-Transfer-Encoding: 7bit Subject: RE: [PHP-DEV] [RFC] Square brackets shortcut From: jani.taskinen@sci.fi (Jani Taskinen) I don't remember ever seeing this before, but I'm still very strongly against this kind of useless syntax sugar.. --Jani On Thu, 2008-01-10 at 11:36 -0800, Andi Gutmans wrote: > I recommended (b) a few months back and got shot down :) > I still like it :) > > Andi > > > -----Original Message----- > > From: Ryusuke SEKIYAMA [mailto:rsky0711@gmail.com] > > Sent: Thursday, January 10, 2008 2:08 AM > > To: internals@lists.php.net > > Cc: Marcus Boerger; Stas Malyshev > > Subject: [PHP-DEV] [RFC] Square brackets shortcut > > > > 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 > -- Patches/Donations: http://pecl.php.net/~jani/