Security update for Core, with self-updated composer
[yaffs-website] / vendor / nikic / php-parser / test / code / parser / stmt / class / name.test
1 Invalid class name
2 -----
3 <?php class self {}
4 -----
5 Cannot use 'self' as class name as it is reserved from 1:13 to 1:16
6 array(
7     0: Stmt_Class(
8         flags: 0
9         name: self
10         extends: null
11         implements: array(
12         )
13         stmts: array(
14         )
15     )
16 )
17 -----
18 <?php class PARENT {}
19 -----
20 Cannot use 'PARENT' as class name as it is reserved from 1:13 to 1:18
21 array(
22     0: Stmt_Class(
23         flags: 0
24         name: PARENT
25         extends: null
26         implements: array(
27         )
28         stmts: array(
29         )
30     )
31 )
32 -----
33 <?php class static {}
34 -----
35 Syntax error, unexpected T_STATIC, expecting T_STRING from 1:13 to 1:18
36 array(
37 )
38 -----
39 <?php class A extends self {}
40 -----
41 Cannot use 'self' as class name as it is reserved from 1:23 to 1:26
42 array(
43     0: Stmt_Class(
44         flags: 0
45         name: A
46         extends: Name(
47             parts: array(
48                 0: self
49             )
50         )
51         implements: array(
52         )
53         stmts: array(
54         )
55     )
56 )
57 -----
58 <?php class A extends PARENT {}
59 -----
60 Cannot use 'PARENT' as class name as it is reserved from 1:23 to 1:28
61 array(
62     0: Stmt_Class(
63         flags: 0
64         name: A
65         extends: Name(
66             parts: array(
67                 0: PARENT
68             )
69         )
70         implements: array(
71         )
72         stmts: array(
73         )
74     )
75 )
76 -----
77 <?php class A extends static {}
78 -----
79 Cannot use 'static' as class name as it is reserved from 1:23 to 1:28
80 array(
81     0: Stmt_Class(
82         flags: 0
83         name: A
84         extends: Name(
85             parts: array(
86                 0: static
87             )
88         )
89         implements: array(
90         )
91         stmts: array(
92         )
93     )
94 )
95 -----
96 <?php class A implements self {}
97 -----
98 Cannot use 'self' as interface name as it is reserved from 1:26 to 1:29
99 array(
100     0: Stmt_Class(
101         flags: 0
102         name: A
103         extends: null
104         implements: array(
105             0: Name(
106                 parts: array(
107                     0: self
108                 )
109             )
110         )
111         stmts: array(
112         )
113     )
114 )
115 -----
116 <?php class A implements PARENT {}
117 -----
118 Cannot use 'PARENT' as interface name as it is reserved from 1:26 to 1:31
119 array(
120     0: Stmt_Class(
121         flags: 0
122         name: A
123         extends: null
124         implements: array(
125             0: Name(
126                 parts: array(
127                     0: PARENT
128                 )
129             )
130         )
131         stmts: array(
132         )
133     )
134 )
135 -----
136 <?php class A implements static {}
137 -----
138 Cannot use 'static' as interface name as it is reserved from 1:26 to 1:31
139 array(
140     0: Stmt_Class(
141         flags: 0
142         name: A
143         extends: null
144         implements: array(
145             0: Name(
146                 parts: array(
147                     0: static
148                 )
149             )
150         )
151         stmts: array(
152         )
153     )
154 )
155 -----
156 <?php interface self {}
157 -----
158 Cannot use 'self' as class name as it is reserved from 1:17 to 1:20
159 array(
160     0: Stmt_Interface(
161         name: self
162         extends: array(
163         )
164         stmts: array(
165         )
166     )
167 )
168 -----
169 <?php interface PARENT {}
170 -----
171 Cannot use 'PARENT' as class name as it is reserved from 1:17 to 1:22
172 array(
173     0: Stmt_Interface(
174         name: PARENT
175         extends: array(
176         )
177         stmts: array(
178         )
179     )
180 )
181 -----
182 <?php interface static {}
183 -----
184 Syntax error, unexpected T_STATIC, expecting T_STRING from 1:17 to 1:22
185 array(
186 )
187 -----
188 <?php interface A extends self {}
189 -----
190 Cannot use 'self' as interface name as it is reserved from 1:27 to 1:30
191 array(
192     0: Stmt_Interface(
193         name: A
194         extends: array(
195             0: Name(
196                 parts: array(
197                     0: self
198                 )
199             )
200         )
201         stmts: array(
202         )
203     )
204 )
205 -----
206 <?php interface A extends PARENT {}
207 -----
208 Cannot use 'PARENT' as interface name as it is reserved from 1:27 to 1:32
209 array(
210     0: Stmt_Interface(
211         name: A
212         extends: array(
213             0: Name(
214                 parts: array(
215                     0: PARENT
216                 )
217             )
218         )
219         stmts: array(
220         )
221     )
222 )
223 -----
224 <?php interface A extends static {}
225 -----
226 Cannot use 'static' as interface name as it is reserved from 1:27 to 1:32
227 array(
228     0: Stmt_Interface(
229         name: A
230         extends: array(
231             0: Name(
232                 parts: array(
233                     0: static
234                 )
235             )
236         )
237         stmts: array(
238         )
239     )
240 )