3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php define('PIZZA', 'time'); var_dump(constant('PIZZA')); var_dump(PIZZA); var_dump(constant('PIE')); var_dump(PIE);
Output for 4.3.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(4) "time" string(4) "time" Warning: constant(): Couldn't find constant PIE in /in/FjcXa on line 5 NULL Notice: Use of undefined constant PIE - assumed 'PIE' in /in/FjcXa on line 6 string(3) "PIE"
Output for 4.3.0 - 4.3.1
string(4) "time" string(4) "time" Warning: constant() [http://www.php.net/function.constant]: Couldn't find constant PIE in /in/FjcXa on line 5 NULL Notice: Use of undefined constant PIE - assumed 'PIE' in /in/FjcXa on line 6 string(3) "PIE"