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
165--EXPECTF--
166Obj::empty
167Obj::callable
168Obj::class
169Obj::trait
170Obj::extends
171Obj::implements
172Obj::static
173Obj::abstract
174Obj::final
175Obj::public
176Obj::protected
177Obj::private
178Obj::const
179Obj::enddeclare
180Obj::endfor
181Obj::endforeach
182Obj::endif
183Obj::endwhile
184Obj::and
185Obj::global
186Obj::goto
187Obj::instanceof
188Obj::insteadof
189Obj::interface
190Obj::namespace
191Obj::new
192Obj::or
193Obj::xor
194Obj::try
195Obj::use
196Obj::var
197Obj::exit
198Obj::list
199Obj::clone
200Obj::include
201Obj::include_once
202Obj::throw
203Obj::array
204Obj::print
205Obj::echo
206Obj::require
207Obj::require_once
208Obj::return
209Obj::else
210Obj::elseif
211Obj::default
212Obj::break
213Obj::continue
214Obj::switch
215Obj::yield
216Obj::function
217Obj::if
218Obj::endswitch
219Obj::finally
220Obj::for
221Obj::foreach
222Obj::declare
223Obj::case
224Obj::do
225Obj::while
226Obj::as
227Obj::catch
228Obj::die
229Obj::self
230Obj::parent
231Obj::isset
232Obj::unset
233Obj::__CLASS__
234Obj::__TRAIT__
235Obj::__FUNCTION__
236Obj::__METHOD__
237Obj::__LINE__
238Obj::__FILE__
239Obj::__DIR__
240Obj::__NAMESPACE__
241
242Done
243