php-parser/test/code/parser/expr/variable.test

67 lines
1.2 KiB
Plaintext
Raw Normal View History

Variable syntaxes
-----
<?php
$a;
${'a'};
${foo()};
2011-12-07 18:17:05 +01:00
$$a;
$$$a;
$$a['b'];
-----
2015-06-13 14:59:24 +02:00
!!php5
array(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_Variable(
name: a
)
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_Variable(
name: Scalar_String(
value: a
)
)
)
2017-01-19 22:25:22 +01:00
2: Stmt_Expression(
expr: Expr_Variable(
name: Expr_FuncCall(
name: Name(
parts: array(
0: foo
)
)
args: array(
)
)
)
)
2017-01-19 22:25:22 +01:00
3: Stmt_Expression(
expr: Expr_Variable(
name: Expr_Variable(
2011-12-07 18:17:05 +01:00
name: a
)
)
)
2017-01-19 22:25:22 +01:00
4: Stmt_Expression(
expr: Expr_Variable(
name: Expr_Variable(
name: Expr_Variable(
name: a
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
)
)
5: Stmt_Expression(
expr: Expr_Variable(
name: Expr_ArrayDimFetch(
var: Expr_Variable(
name: a
)
dim: Scalar_String(
value: b
)
)
)
)
2017-01-19 22:25:22 +01:00
)