]> granicus.if.org Git - php/commitdiff
add missing test for class member access with deference
authorMárcio Almada <marcio3w@gmail.com>
Mon, 9 Feb 2015 16:10:33 +0000 (13:10 -0300)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 11 Feb 2015 14:23:20 +0000 (15:23 +0100)
relates to https://wiki.php.net/rfc/uniform_variable_syntax

Zend/tests/varSyntax/constClassMemberAccess.phpt [new file with mode: 0644]

diff --git a/Zend/tests/varSyntax/constClassMemberAccess.phpt b/Zend/tests/varSyntax/constClassMemberAccess.phpt
new file mode 100644 (file)
index 0000000..41d871a
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Const class member access with deference
+--FILE--
+<?php
+
+class A {
+    const A = ['a' => ['b' => 'c']];
+}
+
+var_dump(A::A);
+var_dump(A::A['a']);
+var_dump(A::A['a']['b']);
+
+?>
+--EXPECT--
+array(1) {
+  ["a"]=>
+  array(1) {
+    ["b"]=>
+    string(1) "c"
+  }
+}
+array(1) {
+  ["b"]=>
+  string(1) "c"
+}
+string(1) "c"
\ No newline at end of file