3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(10,8,7,1,2,3,4,5,6); sort($arr); var_dump($arr);exit; foreach ($arr as $k => $v) { if ($k == 2) { unset($arr[$k]); } } reset($arr); var_dump($arr[2]);
based on 5NqWL
Output for 4.3.0 - 7.2.0
array(9) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) [4]=> int(5) [5]=> int(6) [6]=> int(7) [7]=> int(8) [8]=> int(10) }