3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array("", 0, array(), "1", "0"); foreach ($a as $b) { $c = (bool)$b; echo "value = 1" . print_r($b) . "2\n"; echo " result = 3" . print_r($c) . "4\n"; echo "5\n\n6"; }
Output for 4.3.0 - 7.1.0
value = 112 result = 314 5 60value = 112 result = 314 5 6Array ( ) value = 112 result = 314 5 61value = 112 1 result = 314 5 60value = 112 result = 314 5 6