1--TEST--
2Test semi-reserved words as class methods
3--FILE--
4<?php
5
6class Obj
7{
8    function empty(){ echo __METHOD__, PHP_EOL; }
9    function callable(){ echo __METHOD__, PHP_EOL; }
10    function class(){ echo __METHOD__, PHP_EOL; }
11    function trait(){ echo __METHOD__, PHP_EOL; }
12    function extends(){ echo __METHOD__, PHP_EOL; }
13    function implements(){ echo __METHOD__, PHP_EOL; }
14    function static(){ echo __METHOD__, PHP_EOL; }
15    function abstract(){ echo __METHOD__, PHP_EOL; }
16    function final(){ echo __METHOD__, PHP_EOL; }
17    function public(){ echo __METHOD__, PHP_EOL; }
18    function protected(){ echo __METHOD__, PHP_EOL; }
19    function private(){ echo __METHOD__, PHP_EOL; }
20    function const(){ echo __METHOD__, PHP_EOL; }
21    function enddeclare(){ echo __METHOD__, PHP_EOL; }
22    function endfor(){ echo __METHOD__, PHP_EOL; }
23    function endforeach(){ echo __METHOD__, PHP_EOL; }
24    function endif(){ echo __METHOD__, PHP_EOL; }
25    function endwhile(){ echo __METHOD__, PHP_EOL; }
26    function and(){ echo __METHOD__, PHP_EOL; }
27    function global(){ echo __METHOD__, PHP_EOL; }
28    function goto(){ echo __METHOD__, PHP_EOL; }
29    function instanceof(){ echo __METHOD__, PHP_EOL; }
30    function insteadof(){ echo __METHOD__, PHP_EOL; }
31    function interface(){ echo __METHOD__, PHP_EOL; }
32    function namespace(){ echo __METHOD__, PHP_EOL; }
33    function new(){ echo __METHOD__, PHP_EOL; }
34    function or(){ echo __METHOD__, PHP_EOL; }
35    function xor(){ echo __METHOD__, PHP_EOL; }
36    function try(){ echo __METHOD__, PHP_EOL; }
37    function use(){ echo __METHOD__, PHP_EOL; }
38    function var(){ echo __METHOD__, PHP_EOL; }
39    function exit(){ echo __METHOD__, PHP_EOL; }
40    function list(){ echo __METHOD__, PHP_EOL; }
41    function clone(){ echo __METHOD__, PHP_EOL; }
42    function include(){ echo __METHOD__, PHP_EOL; }
43    function include_once(){ echo __METHOD__, PHP_EOL; }
44    function throw(){ echo __METHOD__, PHP_EOL; }
45    function array(){ echo __METHOD__, PHP_EOL; }
46    function print(){ echo __METHOD__, PHP_EOL; }
47    function echo(){ echo __METHOD__, PHP_EOL; }
48    function readonly(){ echo __METHOD__, PHP_EOL; }
49    function require(){ echo __METHOD__, PHP_EOL; }
50    function require_once(){ echo __METHOD__, PHP_EOL; }
51    function return(){ echo __METHOD__, PHP_EOL; }
52    function else(){ echo __METHOD__, PHP_EOL; }
53    function elseif(){ echo __METHOD__, PHP_EOL; }
54    function default(){ echo __METHOD__, PHP_EOL; }
55    function break(){ echo __METHOD__, PHP_EOL; }
56    function continue(){ echo __METHOD__, PHP_EOL; }
57    function switch(){ echo __METHOD__, PHP_EOL; }
58    function yield(){ echo __METHOD__, PHP_EOL; }
59    function function(){ echo __METHOD__, PHP_EOL; }
60    function fn(){ echo __METHOD__, PHP_EOL; }
61    function if(){ echo __METHOD__, PHP_EOL; }
62    function endswitch(){ echo __METHOD__, PHP_EOL; }
63    function finally(){ echo __METHOD__, PHP_EOL; }
64    function for(){ echo __METHOD__, PHP_EOL; }
65    function foreach(){ echo __METHOD__, PHP_EOL; }
66    function declare(){ echo __METHOD__, PHP_EOL; }
67    function case(){ echo __METHOD__, PHP_EOL; }
68    function do(){ echo __METHOD__, PHP_EOL; }
69    function while(){ echo __METHOD__, PHP_EOL; }
70    function as(){ echo __METHOD__, PHP_EOL; }
71    function catch(){ echo __METHOD__, PHP_EOL; }
72    function die(){ echo __METHOD__, PHP_EOL; }
73    function self(){ echo __METHOD__, PHP_EOL; }
74    function parent(){ echo __METHOD__, PHP_EOL; }
75    function isset(){ echo __METHOD__, PHP_EOL; }
76    function unset(){ echo __METHOD__, PHP_EOL; }
77    function __CLASS__(){ echo __METHOD__, PHP_EOL; }
78    function __TRAIT__(){ echo __METHOD__, PHP_EOL; }
79    function __FUNCTION__(){ echo __METHOD__, PHP_EOL; }
80    function __METHOD__(){ echo __METHOD__, PHP_EOL; }
81    function __LINE__(){ echo __METHOD__, PHP_EOL; }
82    function __FILE__(){ echo __METHOD__, PHP_EOL; }
83    function __DIR__(){ echo __METHOD__, PHP_EOL; }
84    function __NAMESPACE__(){ echo __METHOD__, PHP_EOL; }
85}
86
87$obj = new Obj;
88
89$obj->empty();
90$obj->callable();
91$obj->class();
92$obj->trait();
93$obj->extends();
94$obj->implements();
95$obj->static();
96$obj->abstract();
97$obj->final();
98$obj->public();
99$obj->protected();
100$obj->private();
101$obj->const();
102$obj->enddeclare();
103$obj->endfor();
104$obj->endforeach();
105$obj->endif();
106$obj->endwhile();
107$obj->and();
108$obj->global();
109$obj->goto();
110$obj->instanceof();
111$obj->insteadof();
112$obj->interface();
113$obj->namespace();
114$obj->new();
115$obj->or();
116$obj->xor();
117$obj->try();
118$obj->use();
119$obj->var();
120$obj->exit();
121$obj->list();
122$obj->clone();
123$obj->include();
124$obj->include_once();
125$obj->throw();
126$obj->array();
127$obj->print();
128$obj->echo();
129$obj->readonly();
130$obj->require();
131$obj->require_once();
132$obj->return();
133$obj->else();
134$obj->elseif();
135$obj->default();
136$obj->break();
137$obj->continue();
138$obj->switch();
139$obj->yield();
140$obj->function();
141$obj->fn();
142$obj->if();
143$obj->endswitch();
144$obj->finally();
145$obj->for();
146$obj->foreach();
147$obj->declare();
148$obj->case();
149$obj->do();
150$obj->while();
151$obj->as();
152$obj->catch();
153$obj->die();
154$obj->self();
155$obj->parent();
156$obj->isset();
157$obj->unset();
158$obj->__CLASS__();
159$obj->__TRAIT__();
160$obj->__FUNCTION__();
161$obj->__METHOD__();
162$obj->__LINE__();
163$obj->__FILE__();
164$obj->__DIR__();
165$obj->__NAMESPACE__();
166
167echo "\nDone\n";
168?>
169--EXPECT--
170Obj::empty
171Obj::callable
172Obj::class
173Obj::trait
174Obj::extends
175Obj::implements
176Obj::static
177Obj::abstract
178Obj::final
179Obj::public
180Obj::protected
181Obj::private
182Obj::const
183Obj::enddeclare
184Obj::endfor
185Obj::endforeach
186Obj::endif
187Obj::endwhile
188Obj::and
189Obj::global
190Obj::goto
191Obj::instanceof
192Obj::insteadof
193Obj::interface
194Obj::namespace
195Obj::new
196Obj::or
197Obj::xor
198Obj::try
199Obj::use
200Obj::var
201Obj::exit
202Obj::list
203Obj::clone
204Obj::include
205Obj::include_once
206Obj::throw
207Obj::array
208Obj::print
209Obj::echo
210Obj::readonly
211Obj::require
212Obj::require_once
213Obj::return
214Obj::else
215Obj::elseif
216Obj::default
217Obj::break
218Obj::continue
219Obj::switch
220Obj::yield
221Obj::function
222Obj::fn
223Obj::if
224Obj::endswitch
225Obj::finally
226Obj::for
227Obj::foreach
228Obj::declare
229Obj::case
230Obj::do
231Obj::while
232Obj::as
233Obj::catch
234Obj::die
235Obj::self
236Obj::parent
237Obj::isset
238Obj::unset
239Obj::__CLASS__
240Obj::__TRAIT__
241Obj::__FUNCTION__
242Obj::__METHOD__
243Obj::__LINE__
244Obj::__FILE__
245Obj::__DIR__
246Obj::__NAMESPACE__
247
248Done
249