All Notable changes to League\Uri will be documented in this file
7.8.1 - 2026-03-16
- None
- Update requirement to use
uri-interfaces7.8.1 - Simplify
VariableBagimplementation
- None
- None
7.8.0 - 2026-01-16
- Added the
Builderclass - Added support for
BackedEnum - Added
transformmethod toUriandUrn
- Fix regression in deprecated
Uri::frombaseUrimethod 175
- None
- None
7.7.0 - 2025-12-08
Uri::isIpv4Hosttells whether the URI host is an IPv4 addressUri::isIpv6Hosttells whether the URI host is an IPv6 addressUri::isIpvFutureHosttells whether the URI host is an IPvFuture addressUri::isRegisteredNameHosttells whether the URI host is a registered nameUri::isDomainHosttells whether the URI host is a domain name
- Query order not respected in
BaseUri::isSameDocumentmethod 165 - Fix Host resolution using the new
HostRecordclass, some registered name were wrongly throwing exceptions. - Fix
Uri::withPathimprove handling of path leading slash presence - Fix
UriTemplate::exapndToUrlandUriTemplate::expandToUrlOrFailadding the missing softErrors argument populated by reference.
- None
- None
7.6.0 - 2025-11-18
League\Uri\Urnobject to specifically work with URN as defined by RFC8141Http::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofHttp::new).Http::whenconditional method to ease component building logic.Uri::parsereturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::fromBaseUriandUri::new) that mimics the behaviour of the upcoming native PHP URI parse method.Uri::tryNewreturns a newUriinstance on success or null on failure (ie: a Relax version ofUri::new).Uri::whenconditional method to ease component building logic.Uri::isOpaquetells whether the URI is opaque or not.Uri::isAbsolutetells whether the URI is absolute or not.Uri::isNetworkPathtells whether the URI is a network path.Uri::isAbsolutePathtells whether the URI is an absolute path.Uri::isRelativePathtells whether the URI is a relative path.Uri::isSameDocumenttells whether both URIs refer to the same document.Uri::equalstells whether both URIs refer to the same document (allows taking into account the fragment component)Uri::isLocalFiletells whether thefilescheme base URI represents a local file.Uri::isCrossOrigintells whether two URI do not share the same origin.Uri::isSameOrigintells whether two URI share the same origin.Uri::getOriginreturns the URI origin as described in the WHATWG URL Living standard specification.Uri::toDisplayStringreturns the human-readable string representation of the URI as an IRI.Uri::toRfc8089The method will return null if the URI scheme is not thefileschemeUri::resolvereturns a newUriinstance resolve against the current instance.Uri::normalizereturns a newUriinstance with a full “normalized-decoded” representation: The URI is normalized (when applicable), and components are percent-decoded. Normalization may contain destructive operation.Uri::withUsernamereturns a newUriinstance with the updated username component.Uri::withPasswordreturns a newUriinstance with the updated password component.Uri::toAsciiStringreturns the URI string representation as per RFC3986Uri::toAsciiStringreturns the URI string representation as per RFC3987 with the host in Unicode form if availableUri::getUnicodeHostreturns the host in Unicode form if available; fallback to its RFC3986 representation otherwiseUriTemplateimplements theStringableinterfaceUriTemplate::expandToUriandUriTemplate::expandToUriOrFailUriTemplate::expandToUrlandUriTemplate::expandToUrlOrFailUriTemplate::expandToPsr7UriandUriTemplate::expandToPsr7UriOrFailUriTemplate::expandandUriTemplate::expandOrFailtake a second optional parameter which represents a base URI to resolve the URI from.- Dependency to
psr/http-factorypackage which is required for the package. - Support for
Uri\Rfc3986\UriandUri\Whatwg\Url
UserInfonow can be constructed and mutated even when theusercomponent is not present. It was silently ignored.UriandHttpnormalization normalized IP against RFC3986 rules and not WHATWG rules.Uri::getOriginnow follows WHATWG cross-origin definitionUrihost encoding compliance to RFC3986 is improved by supporting RFC3986 encoded URI properlyUriparsing with strings started or ended with empty string are no longer allowedUrispace are rawurlencoded.Urivalidatesurnas per RFC 8141Urivalidatesmailtoscheme as per RFC 6068Urivalidatesblobscheme as per Blob DefinitionUri::getPathno longer trim the leading slashes (theHttpclass which is a PSR-7 compliant class still do!)
BasUriuse theUriclass or the uri-componentModifierclass depending on your requirements.
- None
7.5.0 - 2024-12-08
Uri::getUsernamereturns the encoded user component of the URI.Uri::getPasswordreturns the encoded password component of the URI.BaseUri::isOpaquetells whether a URI is opaque.- Using PHP8.4
Deprecatedattribute to signal deprecated public API methods and constants.
- Improve PSR-7
Httpclass implementation. BaseUri::fromwill compress the IPv6 host to its compressed form if possible.
- Usage of PSR-7
UriFactoryInterfaceis deprecated inBaseUriclass
- None
7.4.1 - 2024-02-23
- None
- Fix package to avoid PHP8.4 deprecation warnings
- None
- None
7.4.0 - 2023-12-01
Uri::fromDataUri::fromRfc8089BaseUri::unixPathBaseUri::windowsPathBaseUri::toRfc8089
- None
- None
- None
7.3.0 - 2023-09-09
- None
- URI Template incorrect when variable name only contains numbers #109 by GrahamCampbell
- Exception message typo fix #121 by GrahamCampbell
- None
- None
7.2.1 - 2023-08-30
- None
composer.jsonconstraints
- None
- None
7.2.0 - 2023-08-30
BasUri::hasIDN
- None
- None
- None
7.1.0 - 2023-08-21
- None
- Using the
Encoderclass to normalize encoding and decoding in all packages
- None
- None
7.0.0 - 2023-08-10
League\Uri\Uri::newLeague\Uri\Uri::fromComponentsLeague\Uri\Uri::fromServerLeague\Uri\Uri::fromWindowsPathLeague\Uri\Uri::fromUnixPathLeague\Uri\Uri::fromFileContentsLeague\Uri\Uri::fromClientLeague\Uri\Uri::fromTemplateLeague\Uri\Http::newLeague\Uri\Http::fromComponentsLeague\Uri\Http::fromBaseUriLeague\Uri\Http::fromServerLeague\Uri\Http::fromTemplateLeague\Uri\UriTemplate::expandOrFailLeague\Uri\UriTemplate\Template::expandOrFailLeague\Uri\UriTemplate\TemplateCanNotBeExpandedLeague\Uri\UriString::parseAuthorityLeague\Uri\UriString::buildAuthorityLeague\Uri\BaseUri
League\Uri\UriInfouri input now supportsStringableandstringtype.League\Uri\UriTemplate\VariableBagimplements theIteratorAggregateinterfaceLeague\Uri\UriTemplate\Operatorto improve internal representation when using UriTemplate features.
League\Uri\UriResolveruseLeague\Uri\BaseUriinsteadLeague\Uri\Uri::createFromStringuseLeague\Uri\Uri::newLeague\Uri\Uri::createFromUriuseLeague\Uri\Uri::newLeague\Uri\Uri::createFromComponentsuseLeague\Uri\Uri::fromComponentsLeague\Uri\Uri::createFromBaseUriuseLeague\Uri\Uri::fromBaseUriLeague\Uri\Uri::createFromServeruseLeague\Uri\Uri::fromServerLeague\Uri\Uri::createFromWindowsPathuseLeague\Uri\Uri::fromWindowsPathLeague\Uri\Uri::createFromUnixPathuseLeague\Uri\Uri::fromUnixPathLeague\Uri\Uri::createFromDataPathuseLeague\Uri\Uri::fromFileContentsLeague\Uri\Http::createFromStringuseLeague\Uri\Http::newLeague\Uri\Http::createFromUriuseLeague\Uri\Http::newLeague\Uri\Http::createFromComponentsuseLeague\Uri\Http::fromComponentsLeague\Uri\Http::createFromBaseUriuseLeague\Uri\Http::fromBaseUriLeague\Uri\Http::createFromServeruseLeague\Uri\Http::fromServerLeague\Uri\UriTemplate\Template::createFromStringuseLeague\Uri\UriTemplate\Template::new
- Support for
__set_state - Support for
__debugInfo League\Uri\UriTemplate\VariableBag::allLeague\Uri\Exceptions\TemplateCanNotBeExpandeduseLeague\Uri\UriTemplate\TemplateCanNotBeExpandedinsteadLeague\Uri\UriStringclass. Class moved to theuri-interfacespackage.
6.8.0 - 2022-09-13
- Added PHP8.2+
SensitiveParameterattributes to user information component
- Optimize URI performance for server intensive usage 206 by @kelunik
- Improve
Templateresolution - Added PHPBench to benchmark the package main functionnalities.
- Normalize
UriInterface::getPathvalue in the context of multiple leading slash characters.
- None
- Support for PHP7.4 and PHP8.0
6.7.2 - 2022-09-13
- None
Http::getPathandUri::getPathmethods returned values are normalized to prevent potential XSS and open redirect vectors.
- None
- None
6.7.1 - 2022-06-29
- None
UriInfo::isCrossOriginmethod is fix to make it work with any PSR-7 compliant object 205
- None
- None
6.7.0 - 2022-06-28
UriInfo::isCrossOriginmethod
- None
- None
- None
6.6.0 - 2022-05-28
- None
- Some errors are moved from
TypeErrortoInvalidArgumentExceptionto align with otherUriInterfacePSR-7 implementations. - Improved documentation by @GwendolenLynch
- Added PSR7 compliance tests from the PHP-HTTP group
- None
- Support for PHP7.3
Uri::toStringas a clean method to return URI string representation.IDNAconversion in now normalize using theUri-Interfacepackage classes
- conversion host component from ASCII to unicode no longer throw
- None
- Support for PHP7.2
HttpFactorya class that implements PSR-17 UriFactoryInterface. The package needs to be present for the class to work.
- Nothing
- None
UriInfo::getOriginto returns the URI origin as described in the WHATWG URL Living standard specificationUriTemplate\Template,UriTemplate\Expression,UriTemplate\VarSpecifier,UriTemplate\VariableBagto improveUriTemplateimplementation.- Added early support for PHP8
UriTemplatecomplete rewrite by reducing deep nested array usage.- Exception misleading message see issue #167
Uri::withSchemeUri validation failed to catch the empty string as an invalid scheme. #171
- Nothing
- None
- None
- Bugfix
UriTemplate::expandto comply with expansion rules for undefined variables #161 thanks Gabe Sullice - Improve package testing settings and environment.
- Nothing
- None
- None
- None
- Nothing
- Hard dependencies on the
ext-mbstringand theext-fileinfoPHP extensions #154 thanks Nicolas Grekas
- Nothing
League\Uri\UriTemplatevariables validation and normalization improved
- Nothing
- Nothing
League\Uri\UriTemplatea class to handle uri template expansion as described in RFC7560 see PR #153
- Nothing
- Nothing
- Nothing
Urishould not depend onintlextension if the host is in its ascii form #141
- Nothing
- Nothing
League\Uri\UriInfo: to get RFC3986 information from an URI objectLeague\Uri\UriResolver: to resolve or relativize an URI objectLeague\Uri\UriString: to parse or build an URL into or from its componentsLeague\Uri\Uri::createFromBaseUrinamed constructorLeague\Uri\Uri::createFromDataPathnamed constructorLeague\Uri\Uri::createFromPsr7named constructorLeague\Uri\Uri::createFromUnixPathnamed constructorLeague\Uri\Uri::createFromWindowsPathnamed constructorLeague\Uri\Http::createFromBaseUrinamed constructor
- Improve parsing and building URI
- All URI object are now finals and supports parameter type widening
League\Uri\Uriimplements theJsonSerializableinterfaceLeague\Uri\Httpimplements theJsonSerializableinterface
- None
- support for PHP7.1 and PHP7.0
createfunction defined in theLeague\Urinamespace replaced byLeague\Uri\Uri::createFromBaseUriLeague\Uri\Factoryreplaced byLeague\Uri\UriLeague\Uri\Datareplaced byLeague\Uri\UriLeague\Uri\Filereplaced byLeague\Uri\UriLeague\Uri\Ftpreplaced byLeague\Uri\UriLeague\Uri\Wsreplaced byLeague\Uri\UriLeague\Uri\UriExceptionreplaced byLeague\Uri\Contract\UriExceptionLeague\Uri\AbstractUriinternal, replaced byLeague\Uri\UriLeague\Uri\Schemesnamespace and all classes insideLeague\Uri\Urino longer implementsLeague\Uri\UriInterface
See packages release notes for more informations
- IPvFuture support
- Adding PHPStan
- Improve RFC3986 compliance
- Improve performance
- remove
mbstringextension requirement
- URI Parser
- URI Hostname parser
- URI Manipulations 1.3.0 Changelog
- URI Components 1.5.0 Changelog
- URI Schemes 1.1.1 Changelog
- Support for PHP7.2
- Support for PHP7.2
- Update library dependencies
- Nothing
- Nothing
The library is now a metapackage, you can read the migration guide for upgrading or the complete documentation for the new version.
- PHP5 support
- Nothing
- issue #91 Path modifier must be RFC3986 compliant
- issue #94 Improve Query parser encoder
Formatter::__invokepath must be RFC3986 compliant
- Nothing
- Nothing
- Nothing
- issue #84
- Nothing
- Nothing
Component::getContentreturns the raw encoded representation of a componentComponent::withContentto create a new instance from a given raw encoded contentgetDecodedmethod to access the decoded content for the following classes:UserPassFragment
- Support for PHP's magic methods
__debugInfoand__set_stateto improve debugging Modifiers\RelativizeModifiers\DecodeUnreservedCharactersPath::createFromSegmentsPath::getSegmentsHost::createFromLabelsHost::getLabelsQuery::createFromPairsQuery::getPairsModifiers\uri_referencefunction to return URI reference state.
- Components encoding/decoding to be more RFC3986 compliant
Host::getRegisterableDomainmust always return a string as per the host interface expected return typeHost::getSubdomainmust always return a string as per the host interface expected return typeHost::isPublicSuffixValidwhen nopublicSuffixinformation is foundHost::isPublicSuffixValidmust always return a string as per the host interface expected return type- On instantiation, query and fragment delimiter are preserved
createFromComponentsfailing withparse_urlresult when no path is defined- On URI transformation
InvalidArgumentExceptionexceptions are emitted instead ofRuntimeExceptionones to normalize exception to PSR-7 Modifiers\Normalizeclass removes dot segments only on URI with absolute path.Modifiers\Normalizeclass decode all unreserved characters.FtpandWsobjects now accept relative reference URI without the scheme.
Component::modifyuseComponent::withContentinsteadHost::getLiteralPort::toIntusePort::getContentinsteadHierarchicalPath::createFromArrayuseHierarchicalPath::createFromSegmentsinsteadHierarchicalPath::toArrayuseHierarchicalPath::getSegmentsinsteadHost::createFromArrayuseHost::createFromLabelsinsteadHost::toArrayuseHost::getLabelsinsteadQuery::createFromArrayuseQuery::createFromPairsinsteadQuery::toArrayuseQuery::getPairsinsteadUriPart::sameValueAs
- Nothing
- Nothing
- Bug fix path encoding issue #38
- Nothing
- Nothing
Formatter::preserveQueryto improve query inclusion in URI string representationFormatter::preserveFragmentto improve fragment inclusion in URI string representationFormatter::__invokeas an alias ofFormatter::formatUriParser::__invokeas an alias ofUriParser::parse
- Improve Uri Component modification issue #29
- Improve Path encoding/decoding issue #28
- Improve lowercase transformation in hostname issue #27
- Fix empty string evaluation issue #31
Formatter::getHostEncodingFormatter::getQueryEncodingFormatter::getQuerySeparatorModifiers\Filters\Flag::withFlagsModifiers\Filters\ForCallbable::withCallableModifiers\Filters\ForCallbable::withCallableModifiers\Filters\Keys::withKeysModifiers\Filters\Label::withLabelModifiers\Filters\Offset::withOffsetModifiers\Filters\QueryString::withQueryModifiers\Filters\Segment::withSegmentModifiers\Filters\Uri::withUriModifiers\DataUriParameters\withParametersModifiers\Extension\withExtensionModifiers\KsortQuery\withAlgorithmModifiers\Typecode\withType
- Nothing
- Nothing
UserandPassencodingHttp::createFromServerhandling userinfo when not usingmod_phpwith$_SERVER['HTTP_AUTHORIZATION']UriParserhandling URI strings with invalid schemeQueryParserhandling numeric index issue #25DataPathmimetype syntax validation issue #21DataPath::withParametersthe;base64binary code now always throw anInvalidArgumentException
- Nothing
- Nothing
Intlextension is now required to use the libraryFileInfoextension is now required to use the library- Domain parsing capabilities to
Hostusingjeremykendall/php-domain-parserpackage UriParserto parse an URI according to RFC3986 rulesQueryParserto parse and build a query string according to RFC3986 rules.League\Uri\Schemes\Generic\AbstractUrito enable better URI extension- URI Modifiers classes to modify URI objects in an uniform way for interoperability
- A
Dataclass to specifically manipulatedataschemed URI - A
Httpclass to specifically manipulatehttp,httpsschemed URI - A
Ftpclass to specifically manipulateftpschemed URI - A
Wsclass to specifically manipulatews,wssschemed URI - A
DataPathcomponent class to manipulate Data-uri path component - A
HierarchicalPathto manipulate Hierarchical-like path component - Support for IP host
- Move namespace from
League\UrltoLeague\Urito avoid dependency hell - Uri components classes are fixed to comply to
RFC3986 - Uri components classes are now all immutable value objects
- Nothing
- Support for
PHP 5.4andPHP 5.3 - Dependency on PHP
parse_url,parse_strandhttp_build_queryfunctions - Dependency on the
True/php-punycodelibrary League\Url\Url,League\Url\UrlImmutable,League\Url\UrlConstantsclasses- Most of the public API is removed