3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array("one"=>1,"two"=>2,"three"=>3); foreach($a as &$b) { var_dump( key($a) ); var_dump( current($a) ); }
based on TAJt0
Output for 7.0.0 - 7.2.0
string(3) "one" int(1) string(3) "one" int(1) string(3) "one" int(1)
Output for 5.3.20 - 5.6.28
string(3) "two" int(2) string(5) "three" int(3) NULL bool(false)