src/Drupal/Component/Utility/SortArray.php
public static function sortByKeyInt($a, $b, $key) {
    $a_weight = (is_array($a) && isset($a[$key])) ? $a[$key] : 0;
    $b_weight = (is_array($b) && isset($b[$key])) ? $b[$key] : 0;

    if ($a_weight == $b_weight) {
      return 0;
    }

    return ($a_weight < $b_weight) ? -1 : 1;
  }
public static function sortByKeyInt($a, $b, $key) {
    $a_weight = (is_array($a) && isset($a[$key])) ? $a[$key] : 0;
    $b_weight = (is_array($b) && isset($b[$key])) ? $b[$key] : 0;

    if ($a_weight == $b_weight) {
      return 0;
    }

    return ($a_weight < $b_weight) ? -1 : 1;
  }
public static function sortByKeyInt ( $ a , $ b , $ key ) { $ a_weight = ( is_array ( $ a ) && isset ( $ a [ $ key ] ) ) ? $ a [ $ key ] : 0 ; $ b_weight = ( is_array ( $ b ) && isset ( $ b [ $ key ] ) ) ? $ b [ $ key ] : 0 ; if ( $ a_weight == $ b_weight ) { return 0 ; } return ( $ a_weight < $ b_weight ) ? - 1 : 1 ; }
Sorts an integer array item by an arbitrary key.

@param array $a
First item for comparison.
@param array $b
Second item for comparison.
@param string $key
The key to use in the comparison.

@return int
The comparison result for uasort().
Sorts an integer array item by an arbitrary key .