3v4l.org

run code in 500+ 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]); }

preferences:
91.53 ms | 2014 KiB | 5 Q