3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { const c = D::c; } $a = new A; print_r($a);
Output for 5.3.28 - 5.3.29, 5.4.20 - 5.6.28, 7.0.0 - 7.1.0
Fatal error: Class 'D' not found in /in/3OtIp on line 6
Process exited with code 255.
Output for 5.0.0 - 5.1.2, hhvm-3.10.0 - 3.12.0
A Object ( )
Output for 5.2.4 - 5.2.12, 5.3.0 - 5.3.27, 5.4.0 - 5.4.19
Fatal error: Class 'D' not found in /in/55Ld6 on line 6
Process exited with code 255.
Output for 5.2.13 - 5.2.17
Fatal error: Undefined class constant 'D::c' in /in/55Ld6 on line 6
Process exited with code 255.
Output for 5.1.3 - 5.2.3
Notice: Use of undefined constant D::c - assumed 'D::c' in /in/55Ld6 on line 6 A Object ( )
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/55Ld6 on line 4
Process exited with code 255.
Output for 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/55Ld6 on line 4
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/55Ld6 on line 4
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected T_CONST, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/3OtIp on line 4
Process exited with code 255.