src/Http/Psr7/Uri.php
public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
    {
        if (null !== $base) {
            $uri = UriResolver::resolve($base, $uri);

            return ($uri->getScheme() === $base->getScheme())
                && ($uri->getAuthority() === $base->getAuthority())
                && ($uri->getPath() === $base->getPath())
                && ($uri->getQuery() === $base->getQuery());
        }

        return '' === $uri->getScheme() && '' === $uri->getAuthority() && '' === $uri->getPath() && '' === $uri->getQuery();
    }
public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null)
    {
        if (null !== $base) {
            $uri = UriResolver::resolve($base, $uri);

            return ($uri->getScheme() === $base->getScheme())
                && ($uri->getAuthority() === $base->getAuthority())
                && ($uri->getPath() === $base->getPath())
                && ($uri->getQuery() === $base->getQuery());
        }

        return '' === $uri->getScheme() && '' === $uri->getAuthority() && '' === $uri->getPath() && '' === $uri->getQuery();
    }
public static function isSameDocumentReference ( UriInterface $ uri , UriInterface $ base = null ) { if ( null !== $ base ) { $ uri = UriResolver :: resolve ( $ base , $ uri ) ; return ( $ uri -> getScheme ( ) === $ base -> getScheme ( ) ) && ( $ uri -> getAuthority ( ) === $ base -> getAuthority ( ) ) && ( $ uri -> getPath ( ) === $ base -> getPath ( ) ) && ( $ uri -> getQuery ( ) === $ base -> getQuery ( ) ) ; } return '' === $ uri -> getScheme ( ) && '' === $ uri -> getAuthority ( ) && '' === $ uri -> getPath ( ) && '' === $ uri -> getQuery ( ) ; }
Whether the URI is a same-document reference.

A same-document reference refers to a URI that is, aside from its fragment
component, identical to the base URI. When no base URI is given, only an empty
URI reference (apart from its fragment) is considered a same-document reference.

@param UriInterface      $uri  The URI to check
@param UriInterface|null $base An optional base URI to compare against

@return bool

@see https://tools.ietf.org/html/rfc3986#section-4.4
Whether the URI is a same - document reference .