3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function trues() { foreach(get_defined_constants() as $k => $v) if(strtolower($k) === "true") var_dump($k,$v); } trues(); echo "----\n"; define('TRUE', 3); trues();
based on lcm1Ti
Output for 7.0.0 - 7.1.0
string(4) "TRUE" bool(true) ---- string(4) "TRUE" bool(true) string(4) "TRUE" int(3)
Output for hhvm-3.10.0 - 3.12.0
string(4) "true" bool(true) string(4) "TRUE" bool(true) ---- Notice: Constant TRUE already defined in /in/82olB on line 10 string(4) "true" bool(true) string(4) "TRUE" bool(true)
Output for 4.3.0 - 5.6.28
string(4) "TRUE" bool(true) ---- string(4) "TRUE" int(3)