mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-14 02:17:31 +01:00
81e53ce0ff
This changset also adds unit tests for Comments and adds a way to test the pretty printer.
71 lines
1.2 KiB
Plaintext
71 lines
1.2 KiB
Plaintext
Static property fetches
|
|
-----
|
|
<?php
|
|
|
|
// property name variations
|
|
A::$b;
|
|
A::$$b;
|
|
A::${'b'};
|
|
|
|
// array access
|
|
A::$b['c'];
|
|
A::$b{'c'};
|
|
|
|
// class name variations can be found in staticCall.test
|
|
-----
|
|
array(
|
|
0: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
parts: array(
|
|
0: A
|
|
)
|
|
)
|
|
name: b
|
|
)
|
|
1: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
parts: array(
|
|
0: A
|
|
)
|
|
)
|
|
name: Expr_Variable(
|
|
name: b
|
|
)
|
|
)
|
|
2: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
parts: array(
|
|
0: A
|
|
)
|
|
)
|
|
name: Scalar_String(
|
|
value: b
|
|
)
|
|
)
|
|
3: Expr_ArrayDimFetch(
|
|
var: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
parts: array(
|
|
0: A
|
|
)
|
|
)
|
|
name: b
|
|
)
|
|
dim: Scalar_String(
|
|
value: c
|
|
)
|
|
)
|
|
4: Expr_ArrayDimFetch(
|
|
var: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
parts: array(
|
|
0: A
|
|
)
|
|
)
|
|
name: b
|
|
)
|
|
dim: Scalar_String(
|
|
value: c
|
|
)
|
|
)
|
|
) |