3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array('1', '2', '3'); foreach ($arr as $key=>$val) { $arr[3] = '999'; echo $val."\n"; } var_dump($arr);
Output for 4.3.0 - 7.2.0
1 2 3 array(4) { [0]=> string(1) "1" [1]=> string(1) "2" [2]=> string(1) "3" [3]=> string(3) "999" }