3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $x = array(-3,5,1,3,2,10); function array_rev($array) { $half_count = count($array)/2; $count = count($array); for ($i = 0; $i <= $half_count; $i++) { $holder = $array[$i]; $array[$i] = $array[$count - ($i + 1)]; $array[$count - ($i + 1)] = $holder; } return $array; } echo array_rev($x);
based on sFMEZ
Output for 5.4.0 - 7.1.0
Notice: Array to string conversion in /in/SQaBV on line 15 Array
Output for 4.3.0 - 5.3.29
Array