phpstorm.dev

PHP ecosystem insights

PHP knowledge

Versioned PHP knowledge with primary sources and explicit verification dates.

Source checks through 2026-10-27 · 57 sources · This published snapshot is over 48 hours old.

Verified 2026-10-23 voting Permanent entry

Filter\Filter and Filter\Flag enums proposal (formerly: deprecate invalid Filter options)

Voting, closes 2026-11-04 00:00 UTC. At 08:54 UTC on 20 October the author posted the vote announcement, one day after the date given in the intent-to-vote message. It links the RFC, PR #24111 and discussion thread 132813, and names one item: "Should the Filter\Filter and Filter\Flag enums be added?" When the page was inspected at about 10:05 UTC (last modified 2026-10-20 08:55 UTC, still version 0.9), its header said Voting (the "Voting thread" field still said "tbd"). The Voting Choices section says "Voting ends on 2026-11-04 at 00:00:00 UTC" and has one primary question requiring a 2/3 majority, "Implement Filter\Filter and Filter\Flag enums as outlined in the RFC?", with Yes/No/Abstain columns. At that time five people had voted and the widget counted 1 Yes, 4 No, 0 Abstain. This is an interim count of an open poll, not a result; ballots can still be cast or changed until it closes. At about 16:05 UTC the same day (page still last modified 08:55 UTC) seven people had voted (crell, cschneid, dharman, kalle, nicolasgrekas, ocramius, timwolla) and the widget counted 1 Yes, 6 No, 0 Abstain; again an interim count. At about 22:05 UTC (page still last modified 08:55 UTC) nine people had voted (adding jordikroon and marandall) and the widget counted 1 Yes, 8 No, 0 Abstain, again interim. At about 10:05 UTC on 22 October (page still last modified 2026-10-20 08:55 UTC) eleven people had voted (adding dunglas and kguest) and the widget counted 1 Yes, 10 No, 0 Abstain; the poll is still open until 4 November, so this is not a result. At about 22:05 UTC on 23 October the page had been edited (last modified 2026-10-23 19:31 UTC by sjoerd): the "Voting thread" field now links 132882 and the "Discussion thread" field links 132813; version 0.9 and the Voting header are unchanged. Twelve people had voted (adding geekcom) and the widget counted 2 Yes, 10 No, 0 Abstain, again an interim count of an open poll. At about 05:05 UTC on 27 October (page still last modified 2026-10-23 19:31 UTC) thirteen people had voted (adding theodorejb) and the widget counted 2 Yes, 11 No, 0 Abstain; the poll is open until 4 November, so this is still not a result. The official RFC index collected at 10:01 UTC lists the RFC as voting. The leftover Future Scope and ecosystem-impact sentences described below were still on the page.

Before the vote: at 10:03 UTC on 19 October the author posted an intent-to-vote message in the original thread saying that voting "will start on October 19, 2026" because "the two-week cool-down period is over". The message uses the former title, "Invalid Filter Options". When the RFC page was inspected at about 16:05 UTC the same day, its header still said Under Discussion with "Voting thread: tbd", it was last modified 2026-10-09 08:03 UTC, and the vote widget still showed 0/0/0. The official RFC index collected at 16:01 UTC still listed it as discussion. The Future Scope and ecosystem-impact sentences left over from the deprecation draft (see below) were still on the page. At about 04:05 UTC on 20 October the page was unchanged (version 0.9, Under Discussion, voting thread "tbd", last modified 2026-10-09 08:03 UTC); the widget read 0/0/0 with "This poll has been closed", so no ballots had been cast. No voting thread had been collected at that time.

On 7 October the author rewrote the RFC at the same URL. Instead of deprecating invalid options, it now proposes adding Filter\Filter and Filter\Flag enums. The page (last modified 2026-10-07 06:06 UTC) is titled "Add Filter\Filter and Filter\Flag Enums" and its status is Under Discussion. It still says version 0.9 and dated 2026-10-03. Its changelog says: "2026-10-07: Revised RFC to reflect the enum implementation in php-src PR #24111." When the official RFC index was collected at 10:01 UTC on 7 October, it listed the page under that title as discussion. Earlier collections did not list it. At 04:16 UTC the author asked for feedback on the updated proposal in the original thread.

Current proposal (7 October revision)

Some text from the earlier draft remains on the page. "Future Scope" still says the RFC "is limited to invalid integer-valued filter and flags options". The ecosystem impact section still says invalid option values "will no longer be silently accepted". Neither statement matches the enum-only proposal. On 9 October (page last modified 08:03 UTC) the author changed the vote question to "Implement Filter\Filter and Filter\Flag enums as outlined in the RFC?" (2/3 majority). The widget still shows 0/0/0 with the generic "This poll has been closed" footer, and no ballot has taken place. The Future Scope and ecosystem text quoted above was unchanged at that time.

Feedback on 9 October

Tim Düsterhus replied that requiring the backing value to combine flags as a bitmask "is an abuse of enums" that cancels their type safety and makes them "fancy constants". They also pointed out the unchanged vote template. The author answered that many filter_var() calls pass only a filter ID with no flags (citing a Sourcegraph search), that a Filter\Flag enum could still help for single flags, and that this should be weighed against the loss of type safety when flags are combined. The author did not announce a change to the flag design.

Tim Düsterhus answered again at 12:22 UTC. They said enums would help filter_var() calls without flags only slightly, would not work for filter_var_array(), and would mix a strong enum with a free-form options field when flags are used. They argued that, if PHP had tagged unions, per-filter options could be passed with the case (for example Filter\Int(allowOctal: true, allowHex: true)), and that adding the enums now would likely block that path. The tagged unions RFC (2020) is listed as inactive in the official index and is not part of PHP.

History: the invalid-option deprecation draft

As first published, the RFC page (version 0.9, dated 2026-10-03, last modified 2026-10-03 05:37 UTC) had the status Draft. Its implementation, discussion and voting threads were marked "tbd". The author announced it on internals at 05:38 UTC on 3 October (message 132778), describing it as opened for feedback. When the official RFC index was collected at 10:01 UTC that day, the RFC was not yet listed, and it was still absent from the index collected at 22:01 UTC. The page contained an unfilled vote template ("Implement $feature…", 0/0/0). No ballot has taken place.

The first on-list reply, from Calvin Buckley at 20:22 UTC on 3 October (message 132779), called the proposal reasonable "at first glance". It suggested possible follow-on RFCs: turning the filter types into an enum and removing the SAPI-side input filters for superglobals. These are one participant's suggestions, not part of this RFC.

At 08:38 UTC on 4 October the author, Muhammed Arshid KV, replied (message 132780). The author agreed that the filter types "would be better handled as a separate, focused RFC for enums" and wrote: "I'll close this RFC and pursue the enum proposal separately". The reply links php-src PR #24111, opened on 4 October. The PR adds backed enums Filter\Filter (filter IDs) and Filter\Flag (flags), which filter_var(), filter_input() and related functions would accept alongside the existing integer constants. Those constants are kept, and alias constants that share a value get only one enum case. As of 4 October no RFC page for the enum proposal was in the official index, and the PR's requested code-owner reviews were still pending. It is an implementation proposal, not an accepted change. The reply does not say whether the invalid-option deprecation will return in another form.

On 4 October at 16:11 UTC a php-src maintainer (iluuu1994) commented on PR #24111 and asked the author to start a mailing-list discussion first. The maintainer added: "I'm not sure it's a good idea to extend this API further." The author agreed. At 03:29 UTC on 5 October the author opened a discussion thread for the enum proposal. They described the enums as type-safe and more discoverable alternatives to the integer constants, which remain supported. They asked for feedback on the API, naming and approach "before preparing the RFC". When checked at 04:01 UTC, no enum RFC page was listed in the official index. The PR was open, had no submitted reviews, and was labelled "RFC" and "ABI break".

On the original thread, Derick Rethans replied to the suggestion of removing SAPI-side input filters that removing the filter defaults "was a mistake" and that the deprecation "ought to be undone, before the extension gets refreshed" (quoted in the author's reply). At 15:15 UTC on 6 October the author answered that the enum PR only aims to modernize the API, and that they will look into the history of the removed defaults before proceeding. As of 6 October no new RFC page or status change had followed.

That draft targeted the integer-valued filter and flags options of filter_var(), filter_var_array(), filter_input() and filter_input_array(). The draft said some invalid values are currently converted to integers silently. Under that draft, PHP 8.7 would emit E_DEPRECATED and PHP 8.8 would throw ValueError. The examples cover two cases:

The draft's backward-compatibility section said that code that relies on implicit conversion of invalid values to integers would need to use the appropriate constants instead.

The deprecation described above was the content of version 0.9 before the 7 October rewrite. The current page no longer proposes it, and the author has not said whether it will return.

Limitations: the earlier draft's introduction mentioned an array passed as flags, but its examples used strings and unknown integers. The flag-combination objection and the API-extension concern raised on the PR are not addressed in the page text as voted on. Which voters chose which option is not recorded here. This page does not describe current behavior beyond what the RFC states. Related: bcrypt length proposal, which uses the same 8.7/8.8 deprecation-then-error schedule.