3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(0); echo 'null == false? ', (null == false) ? 'yes' : 'no', "\n"; echo 'null == 0 ? ', (null == 0) ? 'yes' : 'no', "\n"; echo 'null == "0" ? ', (null == "0") ? 'yes' : 'no', "\n"; echo 'null == $foo ? ', (null == $foo) ? 'yes' : 'no', "\n"; echo 'null == "" ? ', (null == "") ? 'yes' : 'no', "\n"; echo 'false == 0 ? ', (false == 0) ? 'yes' : 'no', "\n"; echo 'false == "0" ? ', (false == "0") ? 'yes' : 'no', "\n"; echo 'false == $foo ? ', (false == $undefined) ? 'yes' : 'no', "\n"; echo 'false == "" ? ', (false == "") ? 'yes' : 'no', "\n"; echo '0 == "0" ? ', (0 == "0") ? 'yes' : 'no', "\n"; echo '0 == $foo ? ', (0 == $undefined) ? 'yes' : 'no', "\n"; echo '0 == "" ? ', (0 == "") ? 'yes' : 'no', "\n"; echo '"0" == $foo ? ', ("0" == $undefined) ? 'yes' : 'no', "\n"; echo '"0" == "" ? ', ("0" == "") ? 'yes' : 'no', "\n"; echo '$foo == "" ? ', ($undefined == "") ? 'yes' : 'no', "\n";
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
null == false? yes null == 0 ? yes null == "0" ? no null == $foo ? yes null == "" ? yes false == 0 ? yes false == "0" ? yes false == $foo ? yes false == "" ? yes 0 == "0" ? yes 0 == $foo ? yes 0 == "" ? yes "0" == $foo ? no "0" == "" ? no $foo == "" ? yes