3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php eval("$foo = function() { echo 'hello!'; };"); $ref = new ReflectionFunction($foo); echo $ref;
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: foo in /in/FLr77 on line 5 Parse error: syntax error, unexpected '=', expecting end of file in /in/FLr77(5) : eval()'d code on line 1
Process exited with code 255.
Output for 5.2.3 - 5.6.28
Notice: Undefined variable: foo in /in/FLr77 on line 5 Parse error: syntax error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Notice: Undefined variable: foo in /in/FLr77 on line 7 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/FLr77:7 Stack trace: #0 /in/FLr77(7): ReflectionFunction->__construct('') #1 {main} thrown in /in/FLr77 on line 7
Process exited with code 255.
Output for 5.1.0 - 5.2.2
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: syntax error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Notice: Undefined variable: foo in /in/FLr77 on line 7 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/FLr77:7 Stack trace: #0 /in/FLr77(7): ReflectionFunction->__construct('') #1 {main} thrown in /in/FLr77 on line 7
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: parse error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Notice: Undefined variable: foo in /in/FLr77 on line 7 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/FLr77:7 Stack trace: #0 /in/FLr77(7): ReflectionFunction->__construct('') #1 {main} thrown in /in/FLr77 on line 7
Process exited with code 255.
Output for 5.0.3
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: parse error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Notice: Undefined variable: foo in /in/FLr77 on line 7 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/FLr77:7 Stack trace: #0 /in/FLr77(7): ReflectionFunction->__construct('') #1 {main} thrown in /in/FLr77 on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.2
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: parse error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Notice: Undefined variable: foo in /in/FLr77 on line 7 Fatal error: Uncaught exception 'ReflectionException' with message 'Function () does not exist' in /in/FLr77:7 Stack trace: #0 {main} thrown in /in/FLr77 on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: syntax error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/FLr77 on line 7
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: parse error, unexpected '=' in /in/FLr77(5) : eval()'d code on line 1 Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/FLr77 on line 7
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Notice: Undefined variable: foo in /in/FLr77 on line 3 Parse error: parse error in /in/FLr77(5) : eval()'d code on line 1 Fatal error: Cannot instantiate non-existent class: reflectionfunction in /in/FLr77 on line 7
Process exited with code 255.