Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34661 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44397 invoked by uid 1010); 10 Jan 2008 19:40:42 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44382 invoked from network); 10 Jan 2008 19:40:42 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2008 19:40:42 -0000 Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=andi@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Windows 2000 SP4, XP SP1 Received: from [212.25.124.162] ([212.25.124.162:9829] helo=mx1.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 55/10-41364-9B476874 for ; Thu, 10 Jan 2008 14:40:42 -0500 Received: from us-ex1.zend.com ([192.168.16.5]) by mx1.zend.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 10 Jan 2008 21:40:39 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Jan 2008 11:40:35 -0800 Message-ID: <698DE66518E7CA45812BD18E807866CE011C7B89@us-ex1.zend.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PHP-DEV] [RFC] Square brackets shortcut Thread-Index: AchTmBgNk8/97d96QCS8uUossm9MMwAKHOXw References: <1199975867.25972.5.camel@sbarrow-desktop> <7f3ed2c30801100649t2eb9f69dj5d2009702a5bb9ec@mail.gmail.com> To: "Hannes Magnusson" , "Sam Barrow" Cc: "PHP Development" X-OriginalArrivalTime: 10 Jan 2008 19:40:39.0134 (UTC) FILETIME=[AD9887E0:01C853C0] Subject: RE: [PHP-DEV] [RFC] Square brackets shortcut From: andi@zend.com ("Andi Gutmans") I think next time Sam has three consecutive responses to the same thread then he loses access to the list for a week :) (same rule for anyone else). Tweaking the 'Subject' won't count as a different thread :) Andi > -----Original Message----- > From: Hannes Magnusson [mailto:hannes.magnusson@gmail.com] > Sent: Thursday, January 10, 2008 6:49 AM > To: Sam Barrow > Cc: PHP Development > Subject: Re: [PHP-DEV] [RFC] Square brackets shortcut >=20 > 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. >=20 >=20 > Please read Andis "checklist" again; > http://news.php.net/php.internals/34494 - same "rules" apply to all > threads. >=20 > -Hannes >=20 > On Jan 10, 2008 3:37 PM, Sam Barrow wrote: > > I just tried this out using option b, and I really like it. > > > > $var =3D [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 =3D [1, 2, 3]; > > > $b =3D ['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 =3D [1, 2, 3]; > > > $b =3D ['foo' =3D> 'orange', 'bar' =3D> 'apple', 'baz' =3D> = 'lemon']; > > > > > > c) Reject and keep using `array()'. > > > e.g. > > > $a =3D array(1, 2, 3); > > > $b =3D array('foo' =3D> 'orange', 'bar' =3D> 'apple', 'baz' = =3D> > '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 > > > > >=20 > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php