Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32715 invoked by uid 1010); 10 Jan 2008 10:07:40 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 32700 invoked from network); 10 Jan 2008 10:07:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2008 10:07:40 -0000 Authentication-Results: pb1.pair.com header.from=rsky0711@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=rsky0711@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 66.249.82.228 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rsky0711@gmail.com X-Host-Fingerprint: 66.249.82.228 wx-out-0506.google.com Received: from [66.249.82.228] ([66.249.82.228:47533] helo=wx-out-0506.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/83-03358-B6EE5874 for ; Thu, 10 Jan 2008 05:07:39 -0500 Received: by wx-out-0506.google.com with SMTP id s14so374689wxc.26 for ; Thu, 10 Jan 2008 02:07:37 -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:mime-version:content-type:content-transfer-encoding:content-disposition; bh=pAhWFATpMwhHWu6nUbPuiQaKMgzdsuS70HqHK0MjjAE=; b=tuewPAibTyzvbnN965SvA3IBnJemEDzvSLMpqqgOXzZjDrCg2j+HtzqdImPEqOLcL0s1QdWTVvbxnh3IAutxMCnBUNmtm2tTbl0a1ZFMWpb3+ClH7TosGOWyTSZMgALX8n2Q0WnmIE6pa9tZCwac6rimsu5wCU+QTW//Iz+4zKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type:content-transfer-encoding:content-disposition; b=aVyHBk9xPvwOXd0HBRyvCYQhiZ4KHsxZr8TjDP70XOsKSLBkOo0UsU8xGLA+xXWr9Q1nK1ovp1hyFbLncrmEmuCkOtPta27Kssc4tn3AFv/D0kdbmM1rVkf8vI4XYuHx/2/dsAoM9SP4PYh1WAQRghvPk0yxVAfXK0opEHfvvkY= Received: by 10.70.39.18 with SMTP id m18mr1157907wxm.50.1199959656528; Thu, 10 Jan 2008 02:07:36 -0800 (PST) Received: by 10.70.15.16 with HTTP; Thu, 10 Jan 2008 02:07:36 -0800 (PST) Message-ID: Date: Thu, 10 Jan 2008 19:07:36 +0900 To: internals@lists.php.net Cc: "Marcus Boerger" , "Stanislav Malyshev" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: [RFC] Square brackets shortcut From: rsky0711@gmail.com ("Ryusuke SEKIYAMA") 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 */