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