public static function compareList(array $a, array $b): int
    {
        foreach ($a as $i => $symbol) {
            // $b finished, but $a not yet
            if (!isset($b[$i])) {
                // $a > $b
                return 1;
            }
            // $a[$i] <=> $b[$i]
            $result = static::compare($symbol, $b[$i]);
            if ($result) {
                //# $a[$i] <> $b[$i]
                return $result;
            }
        }
        // $b starts with $a
        // if $b longer then $a
        if (count($b) > count($a)) {
            // $a < $b
            return -1;
        }
        // $a == $b
        return 0;
    }
public static function compareList(array $a, array $b): int
    {
        foreach ($a as $i => $symbol) {
            // $b finished, but $a not yet
            if (!isset($b[$i])) {
                // $a > $b
                return 1;
            }
            // $a[$i] <=> $b[$i]
            $result = static::compare($symbol, $b[$i]);
            if ($result) {
                //# $a[$i] <> $b[$i]
                return $result;
            }
        }
        // $b starts with $a
        // if $b longer then $a
        if (count($b) > count($a)) {
            // $a < $b
            return -1;
        }
        // $a == $b
        return 0;
    }
public static function compareList ( array $ a , array $ b ) : int { foreach ( $ a as $ i => $ symbol ) { // $b finished, but $a not yet if ( ! isset ( $ b [ $ i ] ) ) { // $a > $b return 1 ; } // $a[$i] <=> $b[$i] $ result = static :: compare ( $ symbol , $ b [ $ i ] ) ; if ( $ result ) { //# $a[$i] <> $b[$i] return $ result ; } } // $b starts with $a // if $b longer then $a if ( count ( $ b ) > count ( $ a ) ) { // $a < $b return - 1 ; } // $a == $b return 0 ; }
Compare two lists of symbols

Lists are equal when both contains equal symbols in the same order.
@param Symbol[] $a
@param Symbol[] $b
@return int Returns 0 then lists are equals
Compare two lists of symbols