Files
PHP-Parser/test/code/parser/expr/fetchAndCall/simpleArrayAccess.test
Nikita Popov beba9c528f Remove support for alternative array syntax in PHP 8 parser
We cannot support both this syntax and property hooks. Drop
support for the alternative syntax in the PHP 8 parser. The
PHP 7 parser still supports it.
2024-07-19 22:29:35 +02:00

62 lines
1.2 KiB
Plaintext

Simple array access
-----
<?php
$a['b'];
$a['b']['c'];
$a[] = $b;
${$a}['b'];
-----
array(
0: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
)
1: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
dim: Scalar_String(
value: c
)
)
)
2: Stmt_Expression(
expr: Expr_Assign(
var: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: null
)
expr: Expr_Variable(
name: b
)
)
)
3: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_Variable(
name: Expr_Variable(
name: a
)
)
dim: Scalar_String(
value: b
)
)
)
)