summaryrefslogtreecommitdiff
path: root/tests/lang/array_shortcut_003.phpt
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2011-07-23 20:23:21 +0000
committerPierre Joye <pajoye@php.net>2011-07-23 20:23:21 +0000
commitcbe0ed86e76c4e25ba7ee507238b4dcbc28f863a (patch)
tree49612a75d1f4c10197fafbd363bfa1ed56826a44 /tests/lang/array_shortcut_003.phpt
parent35f58b972f4172a63e99fdd118a7c7c3e041555d (diff)
downloadphp-git-cbe0ed86e76c4e25ba7ee507238b4dcbc28f863a.tar.gz
- add short array syntax as defined in https://wiki.php.net/rfc/shortsyntaxforarrays, 2nd solution using => only
Diffstat (limited to 'tests/lang/array_shortcut_003.phpt')
-rw-r--r--tests/lang/array_shortcut_003.phpt13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/lang/array_shortcut_003.phpt b/tests/lang/array_shortcut_003.phpt
new file mode 100644
index 0000000000..75e428b63e
--- /dev/null
+++ b/tests/lang/array_shortcut_003.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Testing array shortcut and bracket operator
+--FILE--
+<?php
+$a = [1, 2, 3, 4, 5];
+print_r([$a[1], $a[3]]);
+?>
+--EXPECT--
+Array
+(
+ [0] => 2
+ [1] => 4
+)