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:
22 ms | 475 KiB | 4 Q