2011-12-04 16:52:43 +01:00
|
|
|
Variable syntaxes
|
|
|
|
-----
|
|
|
|
<?php
|
|
|
|
|
|
|
|
$a;
|
|
|
|
${'a'};
|
|
|
|
${foo()};
|
2011-12-07 18:17:05 +01:00
|
|
|
$$a;
|
|
|
|
$$$a;
|
|
|
|
$$a['b'];
|
2011-12-04 16:52:43 +01:00
|
|
|
-----
|
2015-06-13 14:59:24 +02:00
|
|
|
!!php5
|
2011-12-04 16:52:43 +01:00
|
|
|
array(
|
2017-01-19 22:25:22 +01:00
|
|
|
0: Stmt_Expression(
|
|
|
|
expr: Expr_Variable(
|
|
|
|
name: a
|
2011-12-04 16:52:43 +01:00
|
|
|
)
|
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
1: Stmt_Expression(
|
|
|
|
expr: Expr_Variable(
|
|
|
|
name: Scalar_String(
|
|
|
|
value: a
|
2011-12-04 16:52:43 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
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(
|
|
|
|
)
|
|
|
|
)
|
2011-12-04 16:52:43 +01:00
|
|
|
)
|
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
3: Stmt_Expression(
|
|
|
|
expr: Expr_Variable(
|
2011-12-04 16:52:43 +01:00
|
|
|
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
|
|
|
|
)
|
2011-12-04 16:52:43 +01:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2017-01-19 22:25:22 +01:00
|
|
|
)
|