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) { $place = $len - 1 - $i; $tmp = $arr[$place]; $arr[$place] = $arr[$i]; $arr[$i] = $tmp; } return $arr; } var_dump(array(1,2,3));
based on dmiDb
Output for 4.3.0 - 7.1.0
array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) }