3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1, 2, 3, 4, 5); foreach ($array as $key => &$item) { //echo "$item\n"; $item = 1; echo $array[$key]; echo "\n"; reset($array); } }
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.26
Parse error: syntax error, unexpected '}' in /in/645J3 on line 11
Process exited with code 255.

preferences:
181.18 ms | 1395 KiB | 63 Q