3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 2 => [ 66 => ['id' => 66, 'count' => 9], 255 => ['id' => 255, 'count' => 20], ], 1 => [ 59 => ['id' => 59, 'count' => 14], 255 => ['id' => 255, 'count' => 73], ] ]; array_walk( $array, fn(&$set) => uasort($set, fn($a, $b) => $b['count'] <=> $a['count']) ); var_export($array);

preferences:
27.06 ms | 406 KiB | 5 Q