public static function diff(DateTime $a, DateTime $b, bool $absolute = false) : self
    {
        $microseconds = $b->microsecond() - $a->microsecond();
        
        if ($absolute) {
            $microseconds = abs($microseconds);
        }
        
        $diff = $a->toInternalDateTime()->diff($b->toInternalDateTime(), $absolute);
        
        return new static($diff, $microseconds);
    }
public static function diff(DateTime $a, DateTime $b, bool $absolute = false) : self
    {
        $microseconds = $b->microsecond() - $a->microsecond();
        
        if ($absolute) {
            $microseconds = abs($microseconds);
        }
        
        $diff = $a->toInternalDateTime()->diff($b->toInternalDateTime(), $absolute);
        
        return new static($diff, $microseconds);
    }
public static function diff ( DateTime $ a , DateTime $ b , bool $ absolute = false ) : self { $ microseconds = $ b -> microsecond ( ) - $ a -> microsecond ( ) ; if ( $ absolute ) { $ microseconds = abs ( $ microseconds ) ; } $ diff = $ a -> toInternalDateTime ( ) -> diff ( $ b -> toInternalDateTime ( ) , $ absolute ) ; return new static ( $ diff , $ microseconds ) ; }
Returns an interval representing the difference between two dates.

@param DateTime $a
@param DateTime $b
@param bool     $absolute

@return self
Returns an interval representing the difference between two dates .