3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [ 'countries' => [ ['country_code' => 'US', 'growth' => 3.57], ['country_code' => 'CA', 'growth' => 4.77], ['country_code' => 'TT', 'growth' => 0], ], 'group_name' => 'North America', ], [ 'countries' => [ ['country_code' => 'BR', 'growth' => 2.19], ['country_code' => 'PE', 'growth' => 1.78], ['country_code' => 'UY', 'growth' => 8.83], ['country_code' => 'MX', 'growth' => 3.83], ], 'group_name' => 'South America', ], ]; var_export( array_map( function ($set) { usort($set['countries'], fn($a, $b) => $b['growth'] <=> $a['growth']); return $set; }, $array ) );
Output for git.master_jit, git.master, rfc.property-hooks
array ( 0 => array ( 'countries' => array ( 0 => array ( 'country_code' => 'CA', 'growth' => 4.77, ), 1 => array ( 'country_code' => 'US', 'growth' => 3.57, ), 2 => array ( 'country_code' => 'TT', 'growth' => 0, ), ), 'group_name' => 'North America', ), 1 => array ( 'countries' => array ( 0 => array ( 'country_code' => 'UY', 'growth' => 8.83, ), 1 => array ( 'country_code' => 'MX', 'growth' => 3.83, ), 2 => array ( 'country_code' => 'BR', 'growth' => 2.19, ), 3 => array ( 'country_code' => 'PE', 'growth' => 1.78, ), ), 'group_name' => 'South America', ), )

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