3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [[ 2 => 9.6 ], [ 497 => 11.666666666667 ], [ 451 => 34 ], [ 459 => 8.8 ], [ 461 => 22.5 ]]; echo 'Before:', PHP_EOL; print_r($array); usort($array, function($a, $b) { return reset($b) <=> reset($a); }); echo 'After:', PHP_EOL; print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Before: Array ( [0] => Array ( [2] => 9.6 ) [1] => Array ( [497] => 11.666666666667 ) [2] => Array ( [451] => 34 ) [3] => Array ( [459] => 8.8 ) [4] => Array ( [461] => 22.5 ) ) After: Array ( [0] => Array ( [451] => 34 ) [1] => Array ( [461] => 22.5 ) [2] => Array ( [497] => 11.666666666667 ) [3] => Array ( [2] => 9.6 ) [4] => Array ( [459] => 8.8 ) )

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:
30.72 ms | 407 KiB | 5 Q