guzzlehttp/uri-template
A polyfill class for uri_template of PHP
v2.0.0
273M downloads/mo
#105 most downloaded on composer
guzzle/uri-template
What this package is like to depend on
Last release 1 months ago
20 Jul 2026
Release timing varies
gaps range from 8 days to 1.9 years
Nearly every release is documented
notes for 15 of 15 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
15 releases · first in 2020
6 releases in the last 12 months
see the full history below
Release timeline
15 releases · Jun 2020 to Jul 2026
2021
2022
2023
2024
2025
2026
Releases
latest 15-
v2.0.020 Jul 2026Release notes
Open source →Changed
- Invalid URI template syntax now throws
InvalidArgumentExceptioninstead of expanding partially - Literal template text is now validated and valid non-ASCII literals are pct-encoded
- URI template variable names and modifiers are now validated according to RFC 6570
- Prefix modifiers are now rejected for list and map values
- Referenced variable values are now validated before expansion
- Dense zero-indexed arrays are expanded as lists and sparse or mixed-key arrays as maps
UriTemplateis now non-instantiable; useUriTemplate::expand()statically- Nested null values in lists and maps are now treated as undefined members and omitted
- Variable values must now be valid UTF-8; invalid byte sequences throw
InvalidArgumentException - Booleans now expand as
1and0at every nesting level - Non-finite floats now throw
InvalidArgumentExceptioninstead of expanding asINForNAN - Non-empty lists whose members are all null are now treated as defined variables
- Variable specifier whitespace padding is now detected with the real whitespace set
UriTemplatenow rejects native PHP serialization and unserialization- Referenced variable values are now detached and formed before expansion begins
- Template syntax is now validated for every expression before variable values are formed
- Stringable objects are now converted to strings once per value position while values are formed
- Invalid UTF-8 in variable values and map keys is now rejected while values are formed
- Finite floats are now converted to their expansion strings while values are formed
- Exceptions thrown by
__toString()now surface while values are formed, before any output exists
Fixed
- Fixed invalid template expressions being accepted as query and path-style parameter names
- Fixed prefix modifiers counting bytes instead of Unicode code points and pct-encoded triplets
- Fixed unsupported variable shapes producing warnings, conversion errors, or
Arrayoutput - Fixed path-style parameter explode rendering empty members as
name=instead of barename - Fixed map keys not using the operator's allow set under reserved and fragment expansion
- Fixed map explode rendering empty members as
name=instead of barenamefor unnamed operators - Fixed the documented variables array type rejecting integer keys for numeric variable names
- Fixed all-null maps throwing with prefix modifiers instead of being skipped as undefined
- Fixed prefix modifiers splitting Unicode code points encoded as multiple pct-encoded triplets
- Fixed path-style composites rendering bare
nameinstead ofname=for empty joined members - Fixed null nested query array members being rejected for their keys instead of being omitted
- Fixed float values expanding with the locale decimal separator on PHP versions before 8.0
- Fixed PCRE engine failures on very long variable names being reported as invalid template syntax
- Fixed invalid UTF-8 errors for list and map members not reporting the member path
- Fixed exception messages embedding raw controls or malformed UTF-8 from expressions and map keys
- Fixed invalid UTF-8 in literal text reported at the segment offset, not the first invalid byte
- Fixed PCRE engine failures during literal text validation being reported as invalid UTF-8
- Fixed PCRE engine failures during variable UTF-8 validation not being reported as runtime errors
- Fixed PCRE engine failures during invalid UTF-8 offset recovery being reported as invalid UTF-8
Release notes
Open source →Changed
- Invalid URI template syntax now throws
InvalidArgumentExceptioninstead of expanding partially - Literal template text is now validated and valid non-ASCII literals are pct-encoded
- URI template variable names and modifiers are now validated according to RFC 6570
- Prefix modifiers are now rejected for list and map values
- Referenced variable values are now validated before expansion
- Dense zero-indexed arrays are expanded as lists and sparse or mixed-key arrays as maps
UriTemplateis now non-instantiable; useUriTemplate::expand()statically- Nested null values in lists and maps are now treated as undefined members and omitted
- Variable values must now be valid UTF-8; invalid byte sequences throw
InvalidArgumentException - Booleans now expand as
1and0at every nesting level - Non-finite floats now throw
InvalidArgumentExceptioninstead of expanding asINForNAN - Non-empty lists whose members are all null are now treated as defined variables
- Variable specifier whitespace padding is now detected with the real whitespace set
UriTemplatenow rejects native PHP serialization and unserialization- Referenced variable values are now detached and formed before expansion begins
- Template syntax is now validated for every expression before variable values are formed
- Stringable objects are now converted to strings once per value position while values are formed
- Invalid UTF-8 in variable values and map keys is now rejected while values are formed
- Finite floats are now converted to their expansion strings while values are formed
- Exceptions thrown by
__toString()now surface while values are formed, before any output exists
Fixed
- Fixed invalid template expressions being accepted as query and path-style parameter names
- Fixed prefix modifiers counting bytes instead of Unicode code points and pct-encoded triplets
- Fixed unsupported variable shapes producing warnings, conversion errors, or
Arrayoutput - Fixed path-style parameter explode rendering empty members as
name=instead of barename - Fixed map keys not using the operator's allow set under reserved and fragment expansion
- Fixed map explode rendering empty members as
name=instead of barenamefor unnamed operators - Fixed the documented variables array type rejecting integer keys for numeric variable names
- Fixed all-null maps throwing with prefix modifiers instead of being skipped as undefined
- Fixed prefix modifiers splitting Unicode code points encoded as multiple pct-encoded triplets
- Fixed path-style composites rendering bare
nameinstead ofname=for empty joined members - Fixed null nested query array members being rejected for their keys instead of being omitted
- Fixed float values expanding with the locale decimal separator on PHP versions before 8.0
- Fixed PCRE engine failures on very long variable names being reported as invalid template syntax
- Fixed invalid UTF-8 errors for list and map members not reporting the member path
- Fixed exception messages embedding raw controls or malformed UTF-8 from expressions and map keys
- Fixed invalid UTF-8 in literal text reported at the segment offset, not the first invalid byte
- Fixed PCRE engine failures during literal text validation being reported as invalid UTF-8
- Fixed PCRE engine failures during variable UTF-8 validation not being reported as runtime errors
- Fixed PCRE engine failures during invalid UTF-8 offset recovery being reported as invalid UTF-8
Removed
- Dropped support for PHP 7.2 and 7.3
- Invalid URI template syntax now throws
-
v1.0.1017 Jul 2026Release notes
Open source →Fixed
- Fixed prefix modifiers counting Unicode code points and pct-encoded characters instead of bytes
Release notes
Open source →Fixed
- Fixed prefix modifiers counting Unicode code points and pct-encoded characters instead of bytes
-
v1.0.908 Jul 2026Release notes
Open source →Changed
- Pass explicit trim characters ahead of the PHP 8.6 trim default change
Release notes
Open source →Changed
- Pass explicit trim characters ahead of the PHP 8.6 trim default change
-
v1.0.823 Jun 2026 -
v1.0.712 Jun 2026Release notes
Open source →Fixed
- Fixed the operator's leading character being omitted when defined variables expand to empty strings
- Fixed non-finite float values emitting coercion warnings on PHP 8.5
Release notes
Open source →Fixed
- Fixed the operator's leading character being omitted when defined variables expand to empty strings
- Fixed non-finite float values emitting coercion warnings on PHP 8.5
-
v1.0.623 May 2026Release notes
Open source →Fixed
- Fixed empty nested arrays adding empty components to exploded query expansions
- Fixed nested query array keys being double-encoded during exploded query expansion
- Fixed reserved and fragment expansion preserving existing pct-encoded triplets in variable values
Release notes
Open source →Fixed
- Fixed empty nested arrays adding empty components to exploded query expansions
- Fixed nested query array keys being double-encoded during exploded query expansion
- Fixed reserved and fragment expansion preserving existing pct-encoded triplets in variable values
-
v1.0.522 Aug 2025 -
v1.0.403 Feb 2025 -
v1.0.303 Dec 2023 -
v1.0.227 Aug 2023Release notes
Open source →Changed
- Officially support PHP 8.2 and 8.3
Fixed
- Fixed using
0as an expanded value
Release notes
Open source →Changed
- Officially support PHP 8.2 and 8.3
Fixed
- Fixed using
0as an expanded value
-
v1.0.107 Oct 2021 -
v1.0.014 Aug 2021 -
v0.2.021 Jul 2020Release notes
Open source →Added
- Support PHP 7.1 and 8.0
Changed
- Renamed
GuzzleHttp\Utility\toGuzzleHttp\UriTemplate\
Fixed
- Delegate RFC 3986 query string encoding to PHP
- Fixed some bugs when parts ofs values are not strings
-
v0.1.130 Jun 2020Release notes
Open source →Fixed
- Fixed an error due to strict_types d47d1b0a8e78a3fac1cd0f69d675fc9e06771ac8
-
v0.1.030 Jun 2020