3v4l.org

run code in 300+ PHP versions simultaneously
<?php $scores = array( "Mike" => array(04, 03, 00, 07, 04, 07, 00, 01, 00, 07, 04), "Kyle" => array(07, 01, 00, 03, 04, 01, 00, 07, 03, 04, 04), "Johnny" => array(07, 07, 00, 03, 00, 04, 00, 01, 01, 04, 03), "Will" => array(03, 04, 00, 03, 04, 07, 00, 01, 00, 07, 04), "Vasques" => array(03, 01, 00, 03, 04, 07, 00, 01, 00, 07, 07) ); /* function cmp($a, $b) { return array_sum($b) - array_sum($a); } usort($scores, "cmp"); */ function sort_function(array $a, array $b) { $arr1_val = array_sum($a); $arr2_val = array_sum($b); return $arr2_val - $arr1_val; } usort($scores,"sort_function"); print_r($scores);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 4 [1] => 3 [2] => 0 [3] => 7 [4] => 4 [5] => 7 [6] => 0 [7] => 1 [8] => 0 [9] => 7 [10] => 4 ) [1] => Array ( [0] => 7 [1] => 1 [2] => 0 [3] => 3 [4] => 4 [5] => 1 [6] => 0 [7] => 7 [8] => 3 [9] => 4 [10] => 4 ) [2] => Array ( [0] => 3 [1] => 4 [2] => 0 [3] => 3 [4] => 4 [5] => 7 [6] => 0 [7] => 1 [8] => 0 [9] => 7 [10] => 4 ) [3] => Array ( [0] => 3 [1] => 1 [2] => 0 [3] => 3 [4] => 4 [5] => 7 [6] => 0 [7] => 1 [8] => 0 [9] => 7 [10] => 7 ) [4] => Array ( [0] => 7 [1] => 7 [2] => 0 [3] => 3 [4] => 0 [5] => 4 [6] => 0 [7] => 1 [8] => 1 [9] => 4 [10] => 3 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
33.37 ms | 404 KiB | 8 Q