atom feed30 messages in net.php.lists.internals[PHP-DEV] [RFC] Square brackets shortcut
FromSent OnAttachments
Ryusuke SEKIYAMAJan 10, 2008 2:07 am 
Marcus BoergerJan 10, 2008 2:18 am 
Saulo ValloryJan 10, 2008 5:36 am 
Hannes MagnussonJan 10, 2008 5:56 am 
Tomi KaistilaJan 10, 2008 6:12 am 
Giedrius DJan 10, 2008 6:18 am 
Sam BarrowJan 10, 2008 6:19 am 
Lukas Kahwe SmithJan 10, 2008 6:23 am 
Sam BarrowJan 10, 2008 6:36 am 
Sam BarrowJan 10, 2008 6:37 am 
Sam BarrowJan 10, 2008 6:39 am 
Hannes MagnussonJan 10, 2008 6:48 am 
Daniel BrownJan 10, 2008 7:03 am 
Andi GutmansJan 10, 2008 11:35 am 
Andi GutmansJan 10, 2008 11:40 am 
PierreJan 10, 2008 11:46 am 
Derick RethansJan 10, 2008 12:09 pm 
David CoallierJan 10, 2008 3:21 pm 
Larry GarfieldJan 10, 2008 5:17 pm 
Tomi KaistilaJan 10, 2008 10:15 pm 
Ron RadkoJan 10, 2008 10:29 pm 
Antony DovgalJan 11, 2008 12:55 am 
Jani TaskinenJan 11, 2008 2:02 am 
Geoffrey SneddonJan 11, 2008 6:17 am 
Mark DennehyJan 11, 2008 6:28 am 
Geoffrey SneddonJan 11, 2008 6:38 am 
Max AntonovJan 11, 2008 7:06 am 
Darius JahandarieJan 19, 2008 7:26 pm 
taylor lukJan 20, 2008 9:36 pm 
Eric ColemanFeb 17, 2008 10:31 am 
Subject:[PHP-DEV] [RFC] Square brackets shortcut
From:Ryusuke SEKIYAMA (rsky@gmail.com)
Date:Jan 10, 2008 2:07:13 am
List:net.php.lists.internals

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 <hel@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