3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array(1,2,3,4,5); print_r($array); foreach($array as $i =>$value){ unset($array[$i]); } print_r($array); $array[]=6; print_r($array); ?>
based on KN03k
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 ) Array ( ) Array ( [5] => 6 )