3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [1,2,3]; foreach ($array as $elt) { var_dump($elt); unset($array[2]); }

preferences:
70.47 ms | 407 KiB | 5 Q