a1de3c8c1260834d20735d8acd53e9a150a135bf
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / expr / fetchAndCall / staticPropertyFetch.test
1 Static property fetches
2 -----
3 <?php
4
5 // property name variations
6 A::$b;
7 A::$$b;
8 A::${'b'};
9
10 // array access
11 A::$b['c'];
12 A::$b{'c'};
13
14 // class name variations can be found in staticCall.test
15 -----
16 array(
17     0: Stmt_Expression(
18         expr: Expr_StaticPropertyFetch(
19             class: Name(
20                 parts: array(
21                     0: A
22                 )
23                 comments: array(
24                     0: // property name variations
25                 )
26             )
27             name: VarLikeIdentifier(
28                 name: b
29             )
30             comments: array(
31                 0: // property name variations
32             )
33         )
34         comments: array(
35             0: // property name variations
36         )
37     )
38     1: Stmt_Expression(
39         expr: Expr_StaticPropertyFetch(
40             class: Name(
41                 parts: array(
42                     0: A
43                 )
44             )
45             name: Expr_Variable(
46                 name: b
47             )
48         )
49     )
50     2: Stmt_Expression(
51         expr: Expr_StaticPropertyFetch(
52             class: Name(
53                 parts: array(
54                     0: A
55                 )
56             )
57             name: Scalar_String(
58                 value: b
59             )
60         )
61     )
62     3: Stmt_Expression(
63         expr: Expr_ArrayDimFetch(
64             var: Expr_StaticPropertyFetch(
65                 class: Name(
66                     parts: array(
67                         0: A
68                     )
69                     comments: array(
70                         0: // array access
71                     )
72                 )
73                 name: VarLikeIdentifier(
74                     name: b
75                 )
76                 comments: array(
77                     0: // array access
78                 )
79             )
80             dim: Scalar_String(
81                 value: c
82             )
83             comments: array(
84                 0: // array access
85             )
86         )
87         comments: array(
88             0: // array access
89         )
90     )
91     4: Stmt_Expression(
92         expr: Expr_ArrayDimFetch(
93             var: Expr_StaticPropertyFetch(
94                 class: Name(
95                     parts: array(
96                         0: A
97                     )
98                 )
99                 name: VarLikeIdentifier(
100                     name: b
101                 )
102             )
103             dim: Scalar_String(
104                 value: c
105             )
106         )
107     )
108     5: Stmt_Nop(
109         comments: array(
110             0: // class name variations can be found in staticCall.test
111         )
112     )
113 )