3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr =array( array(1,22,3,6,3), array(4,16,2,10,1), array(11,2,3,5,9), array(3,8,12,4,8) ); function vhall_sort($arr){ $a=$new=array(); foreach($arr as $k=>$v){ $num=array_sum($v); $a[$k]=$num/count($v); } arsort($a); foreach ($a as $k=>$v){ $new[$k] = $arr[$k]; } return $new } echo '<pre>'; print_r($arr); print_r(vhall_sort($arr));
Output for 5.3.0 - 5.4.31
Parse error: syntax error, unexpected '}' in /in/Xm28M on line 20
Process exited with code 255.