3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array("one", "two", "three"); reset($arr); while (list($key, $value) = each($arr)) { echo "Key: $key; Value: $value<br />\n"; } foreach ($arr as $key => $value) { //echo "Key: $key; Value: $value<br />\n"; switch($key) { case "one": echo $key; } } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Key: 0; Value: one<br /> Key: 1; Value: two<br /> Key: 2; Value: three<br /> 0