3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = [0, 1, 2]; foreach ($array as $key=> &$val) { var_dump(current($array)); //var_dump($key); }
Output for 5.6.30
int(1) int(2) bool(false)