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

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

        $nanos = $this->nano - $that->nano;

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

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

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

        $nanos = $this->nano - $that->nano;

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

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

@param LocalTime $that The time to compare to.

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