3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { for ($i = 0; $i <= count($array)/2; $i++) { $holder = $array[$i]; $array[$i] = $array[count($array) - ($i + 1)]; echo $array[$i]; echo " "; $array[count($array) - ($i + 1)] = $holder; echo $array[count($array) - ($i + 1)]; } } array_rev($x);
based on 620Qi
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
10 -32 53 13 1