3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function compare($a, $b) { $order = array('ACO', 'ZCO', 'Other'); $ai = array_search($a, $order); $bi = array_search($b, $order); return $ai<$bi ? -1 : $ai>$bi; } $a = array('ZCO'=>1, 'Other'=>1, 'ACO'=>1); uksort($a, "compare"); print_r($a);
Output for 4.3.0 - 7.1.0
Array ( [ACO] => 1 [ZCO] => 1 [Other] => 1 )