Uri\QueryParams query parameter proposal
Under discussion; not accepted. The RFC page (version 1.0, dated 2026-02-13, last edited 2026-10-06 at 13:08 UTC according to the wiki's change feed) and the official RFC index both list it as Under Discussion. It proposes the "next minor version after PHP 8.6 (likely PHP 8.7)". Acceptance would need a 2/3 majority.
The proposal was split out of the accepted
ext/uri follow-up RFC and builds on the URI extension
that PHP 8.5 added (Uri\Rfc3986\Uri and
Uri\WhatWg\Url). It would add one immutable class, Uri\QueryParams, that stores query
parameters as an ordered list of name-value pairs, with no global request state. It has:
- parsers for RFC 1866 form encoding, RFC 3986 and the WHATWG URL rules, plus
fromArray(). Parsing percent-decodes the input. It does not require a syntactically valid query component; strings are percent-encoded again when the to*String() methods recompose them; getFirst(),getLast(),getAll()andlist()retrieval, and modifiers (append(),set(),delete(),sort()) that return new instances;- default parsing limits of 10,000 input bytes and 1,000 parameters. These can be configured,
and exceeding them throws
Uri\InvalidQueryParamsException; - configurable mappings for boolean values and a
Uri\QueryParamNullPolicyenum fornullvalues (SkipTuple,KeyOnlyas the default,EmptyString), and an array API for PHP's bracket notation.toArray()takes a nesting limit (default 64). The RFC saystoArray()is not a general inverse offromArray(); getQueryParams()andwithQueryParams()methods onUri\Rfc3986\UriandUri\WhatWg\Url;- different empty-field rules per parser.
parseRfc1866()andparseRfc3986()keep empty fields (for example the one after a trailing&) and give a field without=anullvalue.parseWhatWgUrlSearchParams()(namedparseWhatWg()before 19 October) drops empty fields and gives such a field an empty string. The RFC says that recomposing and reparsing a list is not guaranteed to reproduce every possible list.
The RFC presents the class as an alternative to $_GET, which it does not propose to change.
It lists the differences someone migrating would see: $_GET replaces dots and spaces in
names with underscores, keeps only the last value of a repeated name, and drops input beyond
max_input_vars with a warning. QueryParams keeps the names as given, keeps all
occurrences, and throws when its own limit is exceeded. The RFC states that the change is
backward compatible.
Evidence and limitations
- The implementation, php-src PR #22551, was an open draft when checked on 2026-10-04. It was last updated 2026-07-05.
- The discussion thread opened in February. Its newest public message was dated 2026-07-16 when checked on 2026-10-04, and no reply mentions the 1, 3 or 4 October page edits. The wiki revision history requires a login, so what those edits changed is unknown. After the 4 October edit, the status, version, open issues ("None"), parsing limits and the vote placeholder were unchanged.
- The wiki change feed shows another edit on 2026-10-06 at 09:21 UTC; the internals feed has no new message on the thread. Afterwards the header still read version 1.0, Under Discussion, and the default parsing limits were still 10,000 bytes and 1,000 parameters. The page and its raw export were truncated at 18,000 characters, so the open issues and vote block were not re-checked.
- The page's vote block still has placeholder dates ("2026-xx-xx") and is marked closed, but its widget carries a 2026-10-30 close date. This page treats the vote as not opened; a close date in a template is not a vote announcement.
- The opening message noted unresolved points (the array API, and whether the class should be
readonly). The current page lists no open issues and declares the class
final readonly. - On 2026-10-06 at 13:37 UTC the author posted a changelog
of the reworked RFC: readonly class,
QueryParamNullPolicyreplacing a boolean option, parsing limits applying only during parsing with the nesting limit belonging totoArray(), documented type conversions, decided array-API questions, the Uri/Url integration methods and specified handling of empty fields, malformed percent-encoding and invalid UTF-8. The author wrote that they would like to "bring this proposal to a vote as soon as possible (but not sooner)". No vote has been announced. The null-policy enum,toArray()nesting default and Uri/Url methods were checked on the page; the rest of the changelog was not checked individually because the page is truncated at 18,000 characters. - The wiki change feed shows a further edit on 2026-10-08 at 11:44 UTC, with no edit summary and no new message on the thread. Afterwards the header still read version 1.0, dated 2026-02-13, Under Discussion, with PR #22551 as the implementation, and the default parsing limits were unchanged. What the edit changed is unknown, and no vote has been announced.
- On 2026-10-09 at 12:05 UTC Tim Düsterhus posted a 14-point review
of the reworked RFC. They called most points minor and said they are "super happy" with the RFC. The
suggestions include: dropping
$maxQueryStringLength(a manualstrlen()check is enough) and perhaps turning the parameter-count limit into a plain argument; passing building options to theto*()methods instead of storing them; droppingparseRfc3986(), because RFC 3986 does not define query-parameter handling; renamingparseWhatWg()to something likeparseUrlSearchParams(); questioninghasValue(),deleteValue()andwithArray(); and noting that the backward compatibility section should mention the new class name in theUrinamespace. They also called accepting invalid percent-encoding sequences risky, without describing a concrete issue. No author reply or page change was seen by 16:02 UTC. - The wiki change feed shows an edit by the author on 2026-10-15 at 13:58 UTC, with no new message on the
internals feed. Afterwards the header still read version 1.0, dated 2026-02-13, Under Discussion, open
issues "None", and the vote block still had placeholder dates. The page still has
$maxQueryStringLength,parseRfc3986(),parseWhatWg(),hasValue(),deleteValue()andwithArray(), so the review's main renaming and removal suggestions were not adopted. What the edit changed is unknown. The middle of the page (about 39,000 characters) was not re-read. - On 2026-10-16 at 12:53 UTC the author replied to the review.
They said they found no vulnerability that the length limit prevents, and would drop
$maxQueryStringLengthunless someone has a use case. The parameter-count limit would then become a plain parameter. They would renamelist()totoList()andparseWhatWg()toparseWhatWgUrlSearchParams(), and switch the RFC 1866 and RFC 3986 parsers to strict parsing, so that invalid query syntax throws (invalid UTF-8 would still be accepted). They would also replacemixedinappend()/set()withstring|int|float|BackedEnum|null, wherenullalways adds a key without a value, and split sorting intosortByBytes()and a WHATWG-compatiblesortByUtf16(). They keptparseRfc3986()because of the+handling (?q=C++givesC++, notC), and kepthasValue(),deleteValue()andwithArray(), citing the WHATWG URLSearchParams specification for the first two. They were still undecided aboutfromArray()conversions and the building options. They said the backward-compatibility section is fixed, but the change feed shows no page edit after 2026-10-15 13:58 UTC. These are stated intentions, not page changes, and no vote has been announced. - The wiki change feed shows another edit on 2026-10-19 at 07:58 UTC, with no new message on the internals feed.
Afterwards the page declares
toList()instead oflist(), and its backward-compatibility section says the new classes may clash with userland symbols but that theUrinamespace belongs to ext/uri since PHP 8.5. Earlier runs did not record the previous wording of that section, so whether it changed in this edit or on 15 October is unknown. The other changes announced on 16 October are not on the page:QueryParamParsingOptionsstill has$maxQueryStringLength, the parser is stillparseWhatWg(),append()/set()still takemixed, there is a singlesort(), and the page still describes tolerant parsing of malformed input. The header still reads version 1.0, Under Discussion, open issues "None", with placeholder vote dates. The full page (about 52,000 characters) was read. - The change feed shows a further edit on 2026-10-19 at 13:30 UTC, again with no new internals message. The full page,
read at about 16:05 UTC, now names the WHATWG parser
parseWhatWgUrlSearchParams()in the API listing and examples;parseWhatWg()no longer appears. The other announced changes are still absent:$maxQueryStringLength,mixedvalues inappend()/set()/hasValue()/deleteValue(), a singlesort()and the tolerant-parsing description (malformed percent-encoding is preserved, not rejected) are unchanged. The header still reads version 1.0, Under Discussion, with placeholder vote dates. - The change feed shows an edit by the author on 2026-10-26 at 10:43 UTC, with no new internals message. The full page
(about 57,000 characters) was read at about 11:05 UTC. The header still reads version 1.0, dated 2026-02-13, Under
Discussion, open issues "None", with placeholder vote dates ("2026-xx-xx") and a 2/3 majority. The announced changes
that were still absent on 19 October are still absent:
$maxQueryStringLength(default 10,000),mixedvalues inappend()/set()/hasValue()/deleteValue(), a singlesort()and tolerant parsing of malformed percent-encoding. The page ends with Rejected Features and Changelog sections. Both say the bracket-awaregetArray(),appendArray()andsetArray()methods were replaced byfromArray(),toArray()andwithArray(). Earlier runs did not record whether those sections existed, so what this edit changed is unknown. No vote has been announced. - A further edit at 15:05 UTC on 2026-10-26 (again without an internals message) leaves the header (version 1.0,
Under Discussion), the placeholder vote dates and
$maxQueryStringLengthunchanged, checked at about 17:10 UTC; what it changed is unknown. - On 2026-10-27 at about 13:54 UTC the author followed up on their
16 October reply. They now think an automatically enforced
$maxQueryStringLengthcan still be useful: parsing is cheap, but other operations such as sorting by long keys may be slow (not measured, they said), and memory use matters "in the light of the recent CVEs". Strict RFC 1866/RFC 3986 parsing would make migrating from$_GETviaparseRfc1866($_SERVER["QUERY_STRING"])harder, because it would reject malformed input that PHP's existing query-string parser accepts. They saidsortByBytes()andsortByUtf16()are now in the RFC. Read at about 17:10 UTC, the page (last modified 2026-10-26 15:05 UTC, so presumably that edit) declaressortByBytes()andsortByUtf16()and still has$maxQueryStringLength(default 10,000); the header still reads version 1.0, Under Discussion. The page was read in two parts and not every section was rechecked. No vote has been announced.
Related: support windows.