3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reverse3($arr) { $len = count($arr); for ($i = 0; $i <= ceil($len/2) - 1; ++$i) { echo $i . "!"; $place = $len - 1 - $i; $tmp = $arr[$place]; $arr[$place] = $arr[$i]; $arr[$i] = $tmp; } return $arr; } var_dump(reverse3(array(1,2,3,4)));
based on Y32hW
Output for 4.3.0 - 7.1.0
0!1!array(4) { [0]=> int(4) [1]=> int(3) [2]=> int(2) [3]=> int(1) }