3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [0, 1, 2]; $ref =& $array; // Necessary to trigger the old behavior foreach ($array as $val) { var_dump($val); unset($array[1]); } var_dump($ref)
Output for 5.4.2 - 5.4.45, 5.5.24 - 5.5.29, 5.6.7 - 5.6.13
Parse error: syntax error, unexpected end of file in /in/EWnJG on line 9
Process exited with code 255.

preferences:
191.51 ms | 1395 KiB | 63 Q