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 7.1.2
int(0) int(0) int(0) int(1) int(0) int(2)
Output for 5.6.30
int(1) int(0) int(2) int(1) bool(false) int(2)