Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34632 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36738 invoked by uid 1010); 10 Jan 2008 10:19:03 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 36723 invoked from network); 10 Jan 2008 10:19:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2008 10:19:03 -0000 Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:51660] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F9/54-03358-511F5874 for ; Thu, 10 Jan 2008 05:19:03 -0500 Received: from dhcp-172-28-204-176.zrh.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id C6C191B3609; Thu, 10 Jan 2008 11:18:58 +0100 (CET) Date: Thu, 10 Jan 2008 11:19:02 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1665325616.20080110111902@marcus-boerger.de> To: "Ryusuke SEKIYAMA" CC: internals@lists.php.net, "Marcus Boerger" , "Stanislav Malyshev" In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut From: helly@php.net (Marcus Boerger) Hello Ryusuke, I like b) ! marcus Thursday, January 10, 2008, 11:07:36 AM, you 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 > */ Best regards, Marcus