mirror of
https://github.com/nikic/PHP-Parser.git
synced 2025-07-24 15:51:32 +02:00
In most circumstances we are interested in the whole string, not the parts split by namespace separator. As names are common, this representation measurably improves memory usage and performance.
104 lines
2.3 KiB
Plaintext
104 lines
2.3 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: Stmt_Expression(
|
|
expr: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
name: A
|
|
comments: array(
|
|
0: // property name variations
|
|
)
|
|
)
|
|
name: VarLikeIdentifier(
|
|
name: b
|
|
)
|
|
comments: array(
|
|
0: // property name variations
|
|
)
|
|
)
|
|
comments: array(
|
|
0: // property name variations
|
|
)
|
|
)
|
|
1: Stmt_Expression(
|
|
expr: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
name: A
|
|
)
|
|
name: Expr_Variable(
|
|
name: b
|
|
)
|
|
)
|
|
)
|
|
2: Stmt_Expression(
|
|
expr: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
name: A
|
|
)
|
|
name: Scalar_String(
|
|
value: b
|
|
)
|
|
)
|
|
)
|
|
3: Stmt_Expression(
|
|
expr: Expr_ArrayDimFetch(
|
|
var: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
name: A
|
|
comments: array(
|
|
0: // array access
|
|
)
|
|
)
|
|
name: VarLikeIdentifier(
|
|
name: b
|
|
)
|
|
comments: array(
|
|
0: // array access
|
|
)
|
|
)
|
|
dim: Scalar_String(
|
|
value: c
|
|
)
|
|
comments: array(
|
|
0: // array access
|
|
)
|
|
)
|
|
comments: array(
|
|
0: // array access
|
|
)
|
|
)
|
|
4: Stmt_Expression(
|
|
expr: Expr_ArrayDimFetch(
|
|
var: Expr_StaticPropertyFetch(
|
|
class: Name(
|
|
name: A
|
|
)
|
|
name: VarLikeIdentifier(
|
|
name: b
|
|
)
|
|
)
|
|
dim: Scalar_String(
|
|
value: c
|
|
)
|
|
)
|
|
)
|
|
5: Stmt_Nop(
|
|
comments: array(
|
|
0: // class name variations can be found in staticCall.test
|
|
)
|
|
)
|
|
)
|