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