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:
71.41 ms | 1976 KiB | 5 Q