3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function reverse3($arr) { $len = count($arr); for ($i = 0; $i < $len/2; ++$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)));
based on 4UVMC
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
0!1!array(3) { [0]=> int(3) [1]=> int(2) [2]=> int(1) }