3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class obj { } function ret_true() { return true; } function ret_false() { return false; } function ret_obj() { return new obj(); } function ret_std() { return new std_class(); } if ($a = ret_true() == true) { var_dump('true:true'); } if ($a = ret_true() == false) { var_dump('true:false'); } if ($a = ret_false() == true) { var_dump('false:true'); } if ($a = ret_false() == false) { var_dump('false:false'); }
based on TeJ0o
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(9) "true:true" string(11) "false:false"