src/Money.php
public function compareTo(Money $other)
    {
        $other = $other->convertToCurrency($this->currency);
        $this->assertSameCurrency($this, $other);

        if ($this->amount == $other->getAmount()) {
            return 0;
        }

        return $this->amount < $other->getAmount() ? -1 : 1;
    }
public function compareTo(Money $other)
    {
        $other = $other->convertToCurrency($this->currency);
        $this->assertSameCurrency($this, $other);

        if ($this->amount == $other->getAmount()) {
            return 0;
        }

        return $this->amount < $other->getAmount() ? -1 : 1;
    }
public function compareTo ( Money $ other ) { $ other = $ other -> convertToCurrency ( $ this -> currency ) ; $ this -> assertSameCurrency ( $ this , $ other ) ; if ( $ this -> amount == $ other -> getAmount ( ) ) { return 0 ; } return $ this -> amount < $ other -> getAmount ( ) ? - 1 : 1 ; }
Compares this Money object to another.

Returns an integer less than, equal to, or greater than zero
if the value of this Money object is considered to be respectively
less than, equal to, or greater than the other Money object.

@param  Money $other
@return integer -1|0|1
@throws CurrencyMismatchException
Compares this Money object to another .