3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( 'key' => 100, 'key2' => 200, 'key3' => 300 ); function getPair($array) { return each($array); } var_dump(getPair($array)); var_dump(getPair($array));
based on XkFM2
Output for 7.2.0 - 7.3.0beta1
Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /in/3ZeJ1 on line 11 array(4) { [1]=> int(100) ["value"]=> int(100) [0]=> string(3) "key" ["key"]=> string(3) "key" } array(4) { [1]=> int(100) ["value"]=> int(100) [0]=> string(3) "key" ["key"]=> string(3) "key" }
Output for 5.5.0 - 7.1.20
array(4) { [1]=> int(100) ["value"]=> int(100) [0]=> string(3) "key" ["key"]=> string(3) "key" } array(4) { [1]=> int(100) ["value"]=> int(100) [0]=> string(3) "key" ["key"]=> string(3) "key" }