Re: [RFC] Square brackets shortcut
| From: | David Coallier | Date: | Thu, 10 Jan 2008 23:21:37 +0000 |
| Subject: | Re: [RFC] Square brackets shortcut | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-34667@lists.php.net to get a copy of this message | ||
On Jan 10, 2008 2:40 PM, Andi Gutmans <andi@zend.com> wrote:
> 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
> >
> > 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 <sam@sambarrow.com> 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 <helly@php.net>:
> > > > > 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
> > >
> > >
> >
> > --
> > PHP Internals - PHP Runtime Development Mailing List
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
>
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
If you want reasons just ask me privately, as Pierre said, no need to argue :)
-1
D