3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 1 => ['id' => 1, 'sort' => 1], 3 => ['id' => 3, 'sort' => 3], 2 => ['id' => 2, 'sort' => 2], ]; uasort($array, fn($a, $b) => $a['sort'] <=> $b['sort']); var_export($array);

preferences:
76.08 ms | 997 KiB | 5 Q