1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-11 08:59:46 +01:00
PHP-Parser/test/code/parser/expr/fetchAndCall/staticPropertyFetch.test

113 lines
2.5 KiB
Plaintext
Raw Normal View History

2011-12-07 18:17:05 +01:00
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(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
comments: array(
0: // property name variations
)
2011-12-07 18:17:05 +01:00
)
name: VarLikeIdentifier(
name: b
)
comments: array(
0: // property name variations
)
2011-12-07 18:17:05 +01:00
)
comments: array(
0: // property name variations
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
name: Expr_Variable(
name: b
2011-12-07 18:17:05 +01:00
)
)
)
2017-01-19 22:25:22 +01:00
2: Stmt_Expression(
expr: Expr_StaticPropertyFetch(
2011-12-07 18:17:05 +01:00
class: Name(
parts: array(
0: A
)
2017-01-19 22:25:22 +01:00
)
name: Scalar_String(
value: b
)
)
)
3: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
comments: array(
0: // array access
)
)
name: VarLikeIdentifier(
name: b
)
comments: array(
0: // array access
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
dim: Scalar_String(
value: c
)
comments: array(
0: // array access
)
2011-12-07 18:17:05 +01:00
)
comments: array(
0: // array access
)
2011-12-07 18:17:05 +01:00
)
2017-01-19 22:25:22 +01:00
4: Stmt_Expression(
expr: Expr_ArrayDimFetch(
var: Expr_StaticPropertyFetch(
class: Name(
parts: array(
0: A
)
2011-12-07 18:17:05 +01:00
)
name: VarLikeIdentifier(
name: b
)
2017-01-19 22:25:22 +01:00
)
dim: Scalar_String(
value: c
2011-12-07 18:17:05 +01:00
)
)
)
5: Stmt_Nop(
comments: array(
0: // class name variations can be found in staticCall.test
)
)
2011-12-07 18:17:05 +01:00
)