Files
PHP-Parser/test/code/parser/expr/fetchAndCall/staticPropertyFetch.test
Nikita Popov 23647573e8 Represent names using string rather than array of parts
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.
2023-05-21 21:25:49 +02:00

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
)
)
)