3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(1,2,3); foreach($a as &$v) { echo "$v\n"; //$a[$i] = $v * 2; $v *= 2; } var_dump($a);
based on tEAYY
Output for 5.3.21 - 7.2.0
1 2 3 array(3) { [0]=> int(2) [1]=> int(4) [2]=> &int(6) }