3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['x', 'y', 'z']; foreach($array as $element) { $array[2] = 'a'; if ($element=='x') { $element = 'a'; } print $element; } var_dump($array);
Output for 7.3.0rc3
ayzarray(3) { [0]=> string(1) "x" [1]=> string(1) "y" [2]=> string(1) "a" }