3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function arr($array) { var_dump(key($array)); var_dump(current($array)); } $a = array('a' => 1, 'b' => 2, 'c' => 3); arr($a); next($a); arr($a); var_dump(key($a)); var_dump(current($a));
Output for 4.4.1, 5.2.4 - 7.1.0
string(1) "a" int(1) string(1) "b" int(2) string(1) "b" int(2)
Output for 4.3.0 - 4.4.0, 4.4.2 - 5.2.3
string(1) "a" int(1) string(1) "a" int(1) string(1) "b" int(2)