php-parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test

72 lines
1.4 KiB
Plaintext
Raw Normal View History

2011-12-07 18:17:05 +01:00
Simple array access
-----
<?php
$a['b'];
$a['b']['c'];
$a[] = $b;
$a{'b'};
${$a}['b'];
-----
array(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_ArrayDimFetch(
2011-12-07 18:17:05 +01:00
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
dim: Scalar_String(
value: c
2011-12-07 18:17:05 +01:00
)
)
)
2017-01-19 22:25:22 +01:00
2: Stmt_Expression(
expr: Expr_Assign(
var: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: null
)
expr: Expr_Variable(
name: b
)
2011-12-07 18:17:05 +01:00
)
)
2017-01-19 22:25:22 +01:00
3: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_Variable(
2011-12-07 18:17:05 +01:00
name: a
)
2017-01-19 22:25:22 +01:00
dim: Scalar_String(
value: b
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
)
4: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_Variable(
name: Expr_Variable(
name: a
)
)
dim: Scalar_String(
value: b
)
2011-12-07 18:17:05 +01:00
)
)
)