3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(1,2,3,4); foreach($arr as $key => $item) if ($item == 3) unset($arr[$key]); var_dump($arr);
based on CCnma
Output for 4.3.0 - 7.2.0
array(3) { [0]=> int(1) [1]=> int(2) [3]=> int(4) }