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 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.28, 8.4.1 - 8.4.14, 8.5.0
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', ), )
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
115.53 ms | 408 KiB | 5 Q