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