This RFC will discuss an language enhancement for simple and easy array definition.
This topic has come up again on the list.
Another solution would be to implement named parameters.
Ryusuke suggested two possibly syntaxes and also provides two patches for a solution:
Square bracket array shortcut - keys and values are separated by colons:
$a = [1, 2, 3]; $b = ['foo': 'orange', 'bar': 'apple', 'baz': 'lemon'];
Square bracket array shortcut - keys and values are separated by double arrows:
$a = [1, 2, 3]; $b = ['foo' => 'orange', 'bar' => 'apple', 'baz' => 'lemon'];
The first solution is more compact: http://www.opendogs.org/pub/php-5.3dev-080109-sbar.patch
The second solution is more “The PHP Way”: http://www.opendogs.org/pub/php-5.3dev-080109-sbar2.patch
Pro and contra arguments that were derived from the list.
This patch has been merged in PHP 5.4.0 and trunk.