mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-03 17:57:59 +01:00
81e53ce0ff
This changset also adds unit tests for Comments and adds a way to test the pretty printer.
54 lines
877 B
Plaintext
54 lines
877 B
Plaintext
Variable syntaxes
|
|
-----
|
|
<?php
|
|
|
|
$a;
|
|
${'a'};
|
|
${foo()};
|
|
$$a;
|
|
$$$a;
|
|
$$a['b'];
|
|
-----
|
|
array(
|
|
0: Expr_Variable(
|
|
name: a
|
|
)
|
|
1: Expr_Variable(
|
|
name: Scalar_String(
|
|
value: a
|
|
)
|
|
)
|
|
2: Expr_Variable(
|
|
name: Expr_FuncCall(
|
|
name: Name(
|
|
parts: array(
|
|
0: foo
|
|
)
|
|
)
|
|
args: array(
|
|
)
|
|
)
|
|
)
|
|
3: Expr_Variable(
|
|
name: Expr_Variable(
|
|
name: a
|
|
)
|
|
)
|
|
4: Expr_Variable(
|
|
name: Expr_Variable(
|
|
name: Expr_Variable(
|
|
name: a
|
|
)
|
|
)
|
|
)
|
|
5: Expr_Variable(
|
|
name: Expr_ArrayDimFetch(
|
|
var: Expr_Variable(
|
|
name: a
|
|
)
|
|
dim: Scalar_String(
|
|
value: b
|
|
)
|
|
)
|
|
)
|
|
) |