public static function _compare($a, $b)
{
$a_q = floatval(Arrays::getValue($a, 'q', 1));
$b_q = floatval(Arrays::getValue($b, 'q', 1));
if ($a_q === $b_q) {
if ($r = self::_compareSubType($a['type'], $b['type'])) {
return $r;
} else {
return self::_compareSubType($a['subtype'], $b['subtype']);
}
} else {
return $a_q < $b_q;
}
}