3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class foo { const bar = 't'; const baz = 'k'; } $n = 'bar'; eval("$m = foo::bar"); echo $m;
based on ovHo7
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Parse error: syntax error, unexpected '=', expecting end of file in /in/r9Mn7(11) : eval()'d code on line 1
Process exited with code 255.
Output for hhvm-3.10.0 - 3.12.0
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Fatal error: syntax error, unexpected '=', expecting $end in /in/r9Mn7(11)(0d3dd6114b5c34fb6d656e875c85880d) : eval()'d code on line 1 Notice: Undefined variable: m in /in/r9Mn7 on line 12
Output for 5.4.11 - 5.6.28
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Parse error: syntax error, unexpected '=' in /in/r9Mn7(11) : eval()'d code on line 1 Notice: Undefined variable: m in /in/r9Mn7 on line 12
Output for 5.1.0 - 5.4.10
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Parse error: syntax error, unexpected '=' in /in/r9Mn7(11) : eval()'d code on line 1 Notice: Undefined variable: m in /in/r9Mn7 on line 12
Process exited with code 255.
Output for 5.0.4 - 5.0.5
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Parse error: parse error, unexpected '=' in /in/r9Mn7(11) : eval()'d code on line 1 Notice: Undefined variable: m in /in/r9Mn7 on line 12
Process exited with code 255.
Output for 5.0.0 - 5.0.3
Notice: Undefined variable: m in /in/r9Mn7 on line 11 Parse error: parse error, unexpected '=' in /in/r9Mn7(11) : eval()'d code on line 1 Notice: Undefined variable: m in /in/r9Mn7 on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/r9Mn7 on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/r9Mn7 on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/r9Mn7 on line 5
Process exited with code 255.