3v4l.org

run code in 300+ PHP versions simultaneously
<?php foreach (preg_split('/,\s*/', '__halt_compiler,abstract,and,array,as,break,callable,case,catch,class,clone,const,continue,declare,default, die,do,echo,else,elseif,empty,enddeclare,endfor,endforeach,endif,endswitch,endwhile,eval,exit,extends,final, finally,for,foreach,function,global,goto,if,implements,include,include_once,instanceof,insteadof,interface, isset,list,namespace,new,or,print,private,protected,public,require,require_once,return,static,switch,throw, trait,try,unset,use,var,while,xor,yield' ) as $keyword) { try { printf("%20s: ", $keyword); eval("echo $keyword::class;"); } catch (Throwable $t) { echo $t->getMessage(), "\n"; } }

Abusive script

This script was stopped while abusing our resources

Output for git.master, git.master_jit
__halt_compiler: syntax error, unexpected token "__halt_compiler" abstract: syntax error, unexpected token "abstract" and: syntax error, unexpected token "and" array: syntax error, unexpected token "::", expecting "(" as: syntax error, unexpected token "as" break: syntax error, unexpected token "break" callable: syntax error, unexpected token "callable" case: syntax error, unexpected token "case" catch: syntax error, unexpected token "catch" class: syntax error, unexpected token "class" clone: syntax error, unexpected token "::" const: syntax error, unexpected token "const" continue: syntax error, unexpected token "continue" declare: syntax error, unexpected token "declare" default: syntax error, unexpected token "default" die: syntax error, unexpected token "::", expecting "," or ";" do: syntax error, unexpected token "do" echo: syntax error, unexpected token "echo" else: syntax error, unexpected token "else" elseif: syntax error, unexpected token "elseif" empty: syntax error, unexpected token "::", expecting "(" enddeclare: syntax error, unexpected token "enddeclare" endfor: syntax error, unexpected token "endfor" endforeach: syntax error, unexpected token "endforeach" endif: syntax error, unexpected token "endif" endswitch: syntax error, unexpected token "endswitch" endwhile: syntax error, unexpected token "endwhile" eval: syntax error, unexpected token "::", expecting "(" exit: syntax error, unexpected token "::", expecting "," or ";" extends: syntax error, unexpected token "extends" final: syntax error, unexpected token "final" finally: syntax error, unexpected token "finally" for: syntax error, unexpected token "for" foreach: syntax error, unexpected token "foreach" function: syntax error, unexpected token "::", expecting "(" global: syntax error, unexpected token "global" goto: syntax error, unexpected token "goto" if: syntax error, unexpected token "if" implements: syntax error, unexpected token "implements" include: syntax error, unexpected token "::" include_once: syntax error, unexpected token "::" instanceof: syntax error, unexpected token "instanceof" insteadof: syntax error, unexpected token "insteadof" interface: syntax error, unexpected token "interface" isset: syntax error, unexpected token "::", expecting "(" list: syntax error, unexpected token "::", expecting "(" namespace: syntax error, unexpected token "namespace" new: syntax error, unexpected token "::" or: syntax error, unexpected token "or" print: syntax error, unexpected token "::" private: syntax error, unexpected token "private" protected: syntax error, unexpected token "protected" public: syntax error, unexpected token "public" require: syntax error, unexpected token "::" require_once: syntax error, unexpected token "::" return: syntax error, unexpected token "return" static: Cannot use "static" in the global scope switch: syntax error, unexpected token "switch" throw: syntax error, unexpected token "::" trait: syntax error, unexpected token "trait" try: syntax error, unexpected token "try" unset: syntax error, unexpected token "unset" use: syntax error, unexpected token "use" var: syntax error, unexpected token "var" while: syntax error, unexpected token "while" xor: syntax error, unexpected token "xor" yield: syntax error, unexpected token "::", expecting "," or ";"
Output for rfc.property-hooks
__halt_compiler: syntax error, unexpected token "__halt_compiler" abstract: syntax error, unexpected token "abstract" and: syntax error, unexpected token "and" array: syntax error, unexpected token "::", expecting "(" as: syntax error, unexpected token "as" break: syntax error, unexpected token "break" callable: syntax error, unexpected token "callable" case: syntax error, unexpected token "case" catch: syntax error, unexpected token "catch" class: syntax error, unexpected token "class" clone: syntax error, unexpected token "::" const: syntax error, unexpected token "const" continue: syntax error, unexpected token "continue" declare: syntax error, unexpected token "declare" default: syntax error, unexpected token "default" die: syntax error, unexpected token "::", expecting "," or ";" do: syntax error, unexpected token "do" echo: syntax error, unexpected token "echo" else: syntax error, unexpected token "else" elseif: syntax error, unexpected token "elseif" empty: syntax error, unexpected token "::", expecting "(" enddeclare: syntax error, unexpected token "enddeclare" endfor: syntax error, unexpected token "endfor" endforeach: syntax error, unexpected token "endforeach" endif: syntax error, unexpected token "endif" endswitch: syntax error, unexpected token "endswitch" endwhile: syntax error, unexpected token "endwhile" eval: syntax error, unexpected token "::", expecting "(" exit: syntax error, unexpected token "::", expecting "," or ";" extends: syntax error, unexpected token "extends" final: syntax error, unexpected token "final" finally: syntax error, unexpected token "finally" for: syntax error, unexpected token "for" foreach: syntax error, unexpected token "foreach" function: syntax error, unexpected token "::", expecting "(" global: syntax error, unexpected token "global" goto: syntax error, unexpected token "goto" if: syntax error, unexpected token "if" implements: syntax error, unexpected token "implements" include: syntax error, unexpected token "::" include_once: syntax error, unexpected token "::" instanceof: syntax error, unexpected token "instanceof" insteadof: syntax error, unexpected token "insteadof" interface: syntax error, unexpected token "interface" isset: syntax error, unexpected token "::", expecting "(" list: syntax error, unexpected token "::", expecting "(" namespace: syntax error, unexpected token "namespace" new: syntax error, unexpected token "::", expecting "class" or: syntax error, unexpected token "or" print: syntax error, unexpected token "::" private: syntax error, unexpected token "private" protected: syntax error, unexpected token "protected" public: syntax error, unexpected token "public" require: syntax error, unexpected token "::" require_once: syntax error, unexpected token "::" return: syntax error, unexpected token "return" static: Cannot use "static" in the global scope switch: syntax error, unexpected token "switch" throw: syntax error, unexpected token "::" trait: syntax error, unexpected token "trait" try: syntax error, unexpected token "try" unset: syntax error, unexpected token "unset" use: syntax error, unexpected token "use" var: syntax error, unexpected token "var" while: syntax error, unexpected token "while" xor: syntax error, unexpected token "xor" yield: syntax error, unexpected token "::", expecting "," or ";"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
114.45 ms | 434 KiB | 5 Q