3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // define class constant linking to a not defined constant const CONST_FOO = FOO; const CONST_BAR = BAR; echo "Define the linked constant AFTER reading:\n"; CONST_FOO; define('FOO', 'Value of FOO'); var_dump(CONST_FOO); echo "Define the linked constant BEFORE reading:\n"; define('BAR', 'Value of BAR'); var_dump(CONST_BAR);
Output for 5.3.0 - 5.6.28, hhvm-3.12.0, 7.0.0 - 7.1.0
Notice: Use of undefined constant FOO - assumed 'FOO' in /in/TYWog on line 5 Notice: Use of undefined constant BAR - assumed 'BAR' in /in/TYWog on line 8 Define the linked constant AFTER reading: string(3) "FOO" Define the linked constant BEFORE reading: string(3) "BAR"
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_CONST in /in/TYWog on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_CONST in /in/TYWog on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/TYWog on line 5
Process exited with code 255.