Mercurial > hg > isophonics-drupal-site
comparison vendor/nikic/php-parser/test/code/parser/expr/new.test @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 5fb285c0d0e3 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 New | |
2 ----- | |
3 <?php | |
4 | |
5 new A; | |
6 new A($b); | |
7 | |
8 // class name variations | |
9 new $a(); | |
10 new $a['b'](); | |
11 new A::$b(); | |
12 // DNCR object access | |
13 new $a->b(); | |
14 new $a->b->c(); | |
15 new $a->b['c'](); | |
16 new $a->b{'c'}(); | |
17 | |
18 // test regression introduces by new dereferencing syntax | |
19 (new A); | |
20 ----- | |
21 array( | |
22 0: Expr_New( | |
23 class: Name( | |
24 parts: array( | |
25 0: A | |
26 ) | |
27 ) | |
28 args: array( | |
29 ) | |
30 ) | |
31 1: Expr_New( | |
32 class: Name( | |
33 parts: array( | |
34 0: A | |
35 ) | |
36 ) | |
37 args: array( | |
38 0: Arg( | |
39 value: Expr_Variable( | |
40 name: b | |
41 ) | |
42 byRef: false | |
43 unpack: false | |
44 ) | |
45 ) | |
46 ) | |
47 2: Expr_New( | |
48 class: Expr_Variable( | |
49 name: a | |
50 ) | |
51 args: array( | |
52 ) | |
53 comments: array( | |
54 0: // class name variations | |
55 ) | |
56 ) | |
57 3: Expr_New( | |
58 class: Expr_ArrayDimFetch( | |
59 var: Expr_Variable( | |
60 name: a | |
61 ) | |
62 dim: Scalar_String( | |
63 value: b | |
64 ) | |
65 ) | |
66 args: array( | |
67 ) | |
68 ) | |
69 4: Expr_New( | |
70 class: Expr_StaticPropertyFetch( | |
71 class: Name( | |
72 parts: array( | |
73 0: A | |
74 ) | |
75 ) | |
76 name: b | |
77 ) | |
78 args: array( | |
79 ) | |
80 ) | |
81 5: Expr_New( | |
82 class: Expr_PropertyFetch( | |
83 var: Expr_Variable( | |
84 name: a | |
85 ) | |
86 name: b | |
87 ) | |
88 args: array( | |
89 ) | |
90 comments: array( | |
91 0: // DNCR object access | |
92 ) | |
93 ) | |
94 6: Expr_New( | |
95 class: Expr_PropertyFetch( | |
96 var: Expr_PropertyFetch( | |
97 var: Expr_Variable( | |
98 name: a | |
99 ) | |
100 name: b | |
101 ) | |
102 name: c | |
103 ) | |
104 args: array( | |
105 ) | |
106 ) | |
107 7: Expr_New( | |
108 class: Expr_ArrayDimFetch( | |
109 var: Expr_PropertyFetch( | |
110 var: Expr_Variable( | |
111 name: a | |
112 ) | |
113 name: b | |
114 ) | |
115 dim: Scalar_String( | |
116 value: c | |
117 ) | |
118 ) | |
119 args: array( | |
120 ) | |
121 ) | |
122 8: Expr_New( | |
123 class: Expr_ArrayDimFetch( | |
124 var: Expr_PropertyFetch( | |
125 var: Expr_Variable( | |
126 name: a | |
127 ) | |
128 name: b | |
129 ) | |
130 dim: Scalar_String( | |
131 value: c | |
132 ) | |
133 ) | |
134 args: array( | |
135 ) | |
136 ) | |
137 9: Expr_New( | |
138 class: Name( | |
139 parts: array( | |
140 0: A | |
141 ) | |
142 ) | |
143 args: array( | |
144 ) | |
145 ) | |
146 ) |