3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $array = array( "id1" => array("unique" => 3), "id2" => array("unique" => 5), "id3" => array("unique" => 1), ); usort($array, function ($a, $b){ if ($a['unique'] == $b) { return 0; } return ($a['unique'] < $a['unique']) ? -1 : 1; });

preferences:
40.89 ms | 402 KiB | 5 Q