src/Carbon/CarbonInterval.php
public static function compareDateIntervals(DateInterval $a, DateInterval $b)
    {
        $current = Carbon::now();
        $passed = $current->copy()->add($b);
        $current->add($a);

        if ($current < $passed) {
            return -1;
        } elseif ($current > $passed) {
            return 1;
        }

        return 0;
    }
public static function compareDateIntervals(DateInterval $a, DateInterval $b)
    {
        $current = Carbon::now();
        $passed = $current->copy()->add($b);
        $current->add($a);

        if ($current < $passed) {
            return -1;
        } elseif ($current > $passed) {
            return 1;
        }

        return 0;
    }
public static function compareDateIntervals ( DateInterval $ a , DateInterval $ b ) { $ current = Carbon :: now ( ) ; $ passed = $ current -> copy ( ) -> add ( $ b ) ; $ current -> add ( $ a ) ; if ( $ current < $ passed ) { return - 1 ; } elseif ( $ current > $ passed ) { return 1 ; } return 0 ; }
Comparing 2 date intervals

@param DateInterval $a
@param DateInterval $b

@return int
Comparing 2 date intervals