src/Instant.php
public function compareTo(Instant $that) : int
    {
        $seconds = $this->getEpochSecond() - $that->getEpochSecond();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->getNano() - $that->getNano();

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }
public function compareTo(Instant $that) : int
    {
        $seconds = $this->getEpochSecond() - $that->getEpochSecond();

        if ($seconds !== 0) {
            return $seconds > 0 ? 1 : -1;
        }

        $nanos = $this->getNano() - $that->getNano();

        if ($nanos !== 0) {
            return $nanos > 0 ? 1 : -1;
        }

        return 0;
    }
public function compareTo ( Instant $ that ) : int { $ seconds = $ this -> getEpochSecond ( ) - $ that -> getEpochSecond ( ) ; if ( $ seconds !== 0 ) { return $ seconds > 0 ? 1 : - 1 ; } $ nanos = $ this -> getNano ( ) - $ that -> getNano ( ) ; if ( $ nanos !== 0 ) { return $ nanos > 0 ? 1 : - 1 ; } return 0 ; }
Compares this instant with another.

@param Instant $that

@return int [-1,0,1] If this instant is before, on, or after the given instant.
Compares this instant with another .