3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function __autoload($class) { var_dump($class); } class foo { const X = bar::X; } var_dump(foo::X);
Output for 5.2.4 - 5.2.12, 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
string(3) "bar" Fatal error: Class 'bar' not found in /in/XM4Re on line 7
Process exited with code 255.
Output for hhvm-3.12.0 - 3.13.2
string(3) "bar" Fatal error: Uncaught Error: Class undefined: bar in /in/XM4Re:5 Stack trace: #0 {main}
Process exited with code 255.
Output for hhvm-3.10.0
string(3) "bar" Fatal error: Class undefined: bar in /in/XM4Re on line 5
Process exited with code 255.
Output for 5.2.13 - 5.2.17
string(3) "bar" Fatal error: Undefined class constant 'bar::X' in /in/XM4Re on line 7
Process exited with code 255.
Output for 5.0.0 - 5.2.3
string(3) "bar" Notice: Use of undefined constant bar::X - assumed 'bar::X' in /in/XM4Re on line 7 string(6) "bar::X"
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/XM4Re 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/XM4Re 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/XM4Re on line 5
Process exited with code 255.