3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['a' => 1, 'b' => 2]; foreach($array as $a) { var_dump(key($array)); }
Output for 7.0.32 - 7.2.12
string(1) "a" string(1) "a"
Output for 5.6.38
string(1) "b" string(1) "b"