public static function compare(Version $a, Version $b)
    {
        $aValues = $a->numeric();
        $bValues = $b->numeric();

        foreach (array_keys(self::$ordinality) as $key) {
            $aVal = $aValues[$key];
            $bVal = $bValues[$key];

            if ($aVal < $bVal) {
                return -1;
            } elseif ($aVal > $bVal) {
                return 1;
            }
        }
        return 0;
    }
public static function compare(Version $a, Version $b)
    {
        $aValues = $a->numeric();
        $bValues = $b->numeric();

        foreach (array_keys(self::$ordinality) as $key) {
            $aVal = $aValues[$key];
            $bVal = $bValues[$key];

            if ($aVal < $bVal) {
                return -1;
            } elseif ($aVal > $bVal) {
                return 1;
            }
        }
        return 0;
    }
public static function compare ( Version $ a , Version $ b ) { $ aValues = $ a -> numeric ( ) ; $ bValues = $ b -> numeric ( ) ; foreach ( array_keys ( self :: $ ordinality ) as $ key ) { $ aVal = $ aValues [ $ key ] ; $ bVal = $ bValues [ $ key ] ; if ( $ aVal < $ bVal ) { return - 1 ; } elseif ( $ aVal > $ bVal ) { return 1 ; } } return 0 ; }
Comparator for version objects

@param Version $a
@param Version $b
@return int
Comparator for version objects