3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['x', 'y', 'z']; foreach($array as &$element) { if ($element=='x') { $element = 'a'; } } function array_fetch(array $a) { $element = current($a); next($a); return $element; } var_dump($array);
based on D76Su
Output for 7.1.25 - 7.3.3
array(3) { [0]=> string(1) "a" [1]=> string(1) "y" [2]=> &string(1) "z" }