3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $firstArray = array("a", "b", "c", "d"); next($firstArray); next($firstArray); var_dump(current($firstArray)); reset($firstArray); foreach ($firstArray as $val) { // Break on "c" if ($val == "c") break; } var_dump(current($firstArray));
Output for hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(1) "c" string(1) "a"
Output for 4.3.0 - 5.6.28
string(1) "c" string(1) "d"