3v4l.org

run code in 300+ PHP versions simultaneously
<?php $inventory = [ ['type' => 'fruit', 'price' => 3.50], ['type' => 'milk', 'price' => 2.90], ['type' => 'pork', 'price' => 5.43], ]; usort( $inventory, fn(array $a, array $b): int => $b['price'] <=> $a['price'] ); print_r($inventory);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Array ( [0] => Array ( [type] => pork [price] => 5.43 ) [1] => Array ( [type] => fruit [price] => 3.5 ) [2] => Array ( [type] => milk [price] => 2.9 ) )

preferences:
106.88 ms | 403 KiB | 128 Q