3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ 1 => ['id' => 1, 'sort' => 1], 3 => ['id' => 3, 'sort' => 3], 2 => ['id' => 2, 'sort' => 2], ]; $keys = array_map(function($val) { return $val['sort']; }, $arr); array_multisort($keys, $arr); var_export($arr);

preferences:
57.3 ms | 998 KiB | 5 Q