3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( "Africa" => array( "Egypt" => array( "20" => array( "basicInfo" => array('population' => 663, 'size' => 23) ) ), "Sudan" => array( "249" => array( "basicInfo" => array('population' => 777, 'size' => 45) ) ) ), "Europe" => array( "Greece" => array( "30" => array( "basicInfo" => array('population' => 12345, 'size' => 97) ) ), "Netherlands" => array( "31" => array( "basicInfo" => array('population' => 2222, 'size' => 33) ) ) ) ); $array = array_map(function ($arr) { uasort($arr, function ($a, $b) { return current($b)['basicInfo']['population'] - current($a)['basicInfo']['population']; }); return $arr; }, $array); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [Africa] => Array ( [Sudan] => Array ( [249] => Array ( [basicInfo] => Array ( [population] => 777 [size] => 45 ) ) ) [Egypt] => Array ( [20] => Array ( [basicInfo] => Array ( [population] => 663 [size] => 23 ) ) ) ) [Europe] => Array ( [Greece] => Array ( [30] => Array ( [basicInfo] => Array ( [population] => 12345 [size] => 97 ) ) ) [Netherlands] => Array ( [31] => Array ( [basicInfo] => Array ( [population] => 2222 [size] => 33 ) ) ) ) )

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:
18.12 ms | 405 KiB | 8 Q