Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/php-static-scanner-instrumentalization.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test')
-rw-r--r--vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test b/vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test
new file mode 100644
index 0000000..ea3f9ef
--- /dev/null
+++ b/vendor/nikic/php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test
@@ -0,0 +1,62 @@
+Simple array access
+-----
+<?php
+
+$a['b'];
+$a['b']['c'];
+$a[] = $b;
+$a{'b'};
+${$a}['b'];
+-----
+array(
+ 0: Expr_ArrayDimFetch(
+ var: Expr_Variable(
+ name: a
+ )
+ dim: Scalar_String(
+ value: b
+ )
+ )
+ 1: Expr_ArrayDimFetch(
+ var: Expr_ArrayDimFetch(
+ var: Expr_Variable(
+ name: a
+ )
+ dim: Scalar_String(
+ value: b
+ )
+ )
+ dim: Scalar_String(
+ value: c
+ )
+ )
+ 2: Expr_Assign(
+ var: Expr_ArrayDimFetch(
+ var: Expr_Variable(
+ name: a
+ )
+ dim: null
+ )
+ expr: Expr_Variable(
+ name: b
+ )
+ )
+ 3: Expr_ArrayDimFetch(
+ var: Expr_Variable(
+ name: a
+ )
+ dim: Scalar_String(
+ value: b
+ )
+ )
+ 4: Expr_ArrayDimFetch(
+ var: Expr_Variable(
+ name: Expr_Variable(
+ name: a
+ )
+ )
+ dim: Scalar_String(
+ value: b
+ )
+ )
+) \ No newline at end of file