3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php 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"; } ?>
based on ORWYG
Output for 7.2.0
Warning: reset() expects parameter 1 to be array, null given in /in/VrpTt on line 2 Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/VrpTt on line 3 Warning: Variable passed to each() is not an array or object in /in/VrpTt on line 3 Warning: Invalid argument supplied for foreach() in /in/VrpTt on line 6
Output for 5.3.18 - 7.1.10
Warning: reset() expects parameter 1 to be array, null given in /in/VrpTt on line 2 Warning: Variable passed to each() is not an array or object in /in/VrpTt on line 3 Warning: Invalid argument supplied for foreach() in /in/VrpTt on line 6