diff -Naru php5.3-200801090930.orig/Zend/zend_language_parser.y php5.3-200801090930.sbar/Zend/zend_language_parser.y --- php5.3-200801090930.orig/Zend/zend_language_parser.y 2007-12-28 22:31:38.000000000 +0900 +++ php5.3-200801090930.sbar/Zend/zend_language_parser.y 2008-01-09 23:40:52.000000000 +0900 @@ -627,6 +627,7 @@ | '@' { zend_do_begin_silence(&$1 TSRMLS_CC); } expr { zend_do_end_silence(&$1 TSRMLS_CC); $$ = $3; } | scalar { $$ = $1; } | T_ARRAY '(' array_pair_list ')' { $$ = $3; } + | '[' array_pair_list ']' { $$ = $2; } | '`' encaps_list '`' { zend_do_shell_exec(&$$, &$2 TSRMLS_CC); } | T_PRINT expr { zend_do_print(&$$, &$2 TSRMLS_CC); } ; @@ -729,6 +730,7 @@ | '+' static_scalar { $$ = $2; } | '-' static_scalar { zval minus_one; Z_TYPE(minus_one) = IS_LONG; Z_LVAL(minus_one) = -1; mul_function(&$2.u.constant, &$2.u.constant, &minus_one TSRMLS_CC); $$ = $2; } | T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } + | '[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; } | static_class_constant { $$ = $1; } ; diff -Naru php5.3-200801090930.orig/tests/lang/array_shortcut_001.phpt php5.3-200801090930.sbar/tests/lang/array_shortcut_001.phpt --- php5.3-200801090930.orig/tests/lang/array_shortcut_001.phpt 1970-01-01 09:00:00.000000000 +0900 +++ php5.3-200801090930.sbar/tests/lang/array_shortcut_001.phpt 2008-01-09 23:40:05.000000000 +0900 @@ -0,0 +1,13 @@ +--TEST-- +Square bracket array shortcut test +--FILE-- + +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 +) diff -Naru php5.3-200801090930.orig/tests/lang/array_shortcut_002.phpt php5.3-200801090930.sbar/tests/lang/array_shortcut_002.phpt --- php5.3-200801090930.orig/tests/lang/array_shortcut_002.phpt 1970-01-01 09:00:00.000000000 +0900 +++ php5.3-200801090930.sbar/tests/lang/array_shortcut_002.phpt 2008-01-09 23:40:05.000000000 +0900 @@ -0,0 +1,13 @@ +--TEST-- +Square bracket associative array shortcut test +--FILE-- + "orange", "bar" => "apple", "baz" => "lemon"]); +?> +--EXPECT-- +Array +( + [foo] => orange + [bar] => apple + [baz] => lemon +) diff -Naru php5.3-200801090930.orig/tests/lang/array_shortcut_003.phpt php5.3-200801090930.sbar/tests/lang/array_shortcut_003.phpt --- php5.3-200801090930.orig/tests/lang/array_shortcut_003.phpt 1970-01-01 09:00:00.000000000 +0900 +++ php5.3-200801090930.sbar/tests/lang/array_shortcut_003.phpt 2008-01-09 23:40:05.000000000 +0900 @@ -0,0 +1,13 @@ +--TEST-- +Testing array shortcut and bracket operator +--FILE-- + +--EXPECT-- +Array +( + [0] => 2 + [1] => 4 +) diff -Naru php5.3-200801090930.orig/tests/lang/array_shortcut_005.phpt php5.3-200801090930.sbar/tests/lang/array_shortcut_005.phpt --- php5.3-200801090930.orig/tests/lang/array_shortcut_005.phpt 1970-01-01 09:00:00.000000000 +0900 +++ php5.3-200801090930.sbar/tests/lang/array_shortcut_005.phpt 2008-01-09 23:40:05.000000000 +0900 @@ -0,0 +1,20 @@ +--TEST-- +Testing nested array shortcut +--FILE-- + "orange", "bar" => "apple", "baz" => "lemon"]]); +?> +--EXPECT-- +Array +( + [0] => 1 + [1] => 2 + [2] => 3 + [3] => Array + ( + [foo] => orange + [bar] => apple + [baz] => lemon + ) + +)