Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: a27d04374aa53bf950965fa711accffb6986774b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
--TEST--
Bug 443037 - Restricted word 'parent' can be used as class name (no error)
--FILE--
<?php
namespace bool
{

    class bool
    {
    }

    interface bool
    {
    }
}

namespace float
{

    class float
    {
    }

    interface float
    {
    }
}

namespace int
{

    class int
    {
    }

    interface int
    {
    }
}

namespace string
{

    class string
    {
    }

    interface string
    {
    }
}

namespace iterable
{

    class iterable
    {
    }

    interface iterable
    {
    }
}

namespace object
{

    class object
    {
    }

    interface object
    {
    }
}

namespace self
{

    class self
    {
    }

    interface self
    {
    }
}

namespace parent
{

    class parent
    {
    }

    interface parent
    {
    }
}

namespace void
{

    class void
    {
    }

    interface void
    {
    }
}

namespace null
{

    class null
    {
    }

    interface null
    {
    }
}

namespace true
{

    class true
    {
    }

    interface true
    {
    }
}

namespace false
{

    class false
    {
    }

    interface false
    {
    }
}

namespace main\bool
{
}

namespace main\float
{
}

namespace main\int
{
}

namespace main\string
{
}

namespace main\iterable
{
}

namespace main\object
{
}

namespace main\self
{
}

namespace main\parent
{
}

namespace main\void
{
}

namespace main\null
{
}

namespace main\true
{
}

namespace main\false
{
}
?>
--EXPECT--
[line=9, start=66, end=70] Cannot declare type bool because the name is already in use
[line=21, start=148, end=153] Cannot declare type float because the name is already in use
[line=33, start=227, end=230] Cannot declare type int because the name is already in use
[line=45, start=310, end=316] Cannot declare type string because the name is already in use
[line=57, start=400, end=408] Cannot declare type iterable because the name is already in use
[line=69, start=488, end=494] Cannot declare type object because the name is already in use
[line=74, start=520, end=524] Cannot use 'self' as namespace name as it is a reserved word
[line=77, start=538, end=542] Cannot use 'self' as class name as it is a reserved word
[line=81, start=570, end=574] Cannot declare type self because the name is already in use
[line=81, start=570, end=574] Cannot use 'self' as interface name as it is a reserved word
[line=86, start=600, end=606] Cannot use 'parent' as namespace name as it is a reserved word
[line=89, start=620, end=626] Cannot use 'parent' as class name as it is a reserved word
[line=93, start=654, end=660] Cannot declare type parent because the name is already in use
[line=93, start=654, end=660] Cannot use 'parent' as interface name as it is a reserved word
[line=105, start=736, end=740] Cannot declare type void because the name is already in use
[line=117, start=816, end=820] Cannot declare type null because the name is already in use
[line=129, start=896, end=900] Cannot declare type true because the name is already in use
[line=141, start=978, end=983] Cannot declare type false because the name is already in use

Back to the top