PHP Policy RFC: exempt input type and value validation from BC Break policy
- Version: 0.1
- Date: 2026-02-18
- Author: Gina Peter Banyard girgias@php.net
- Status: Under Discussion
- First Published at: https://wiki.php.net/rfc/policy-exempt-type-value-error-bc-policy
Introduction
PHP's release cycle does not only affect the release of the core language, but also all extensions that are “bundled”. Bundled extensions are all the extensions that live in the php-src monorepo. This includes many extensions that are not mandatory such as ext/snmp or ext/curl.
Many of these bundled extensions also haven't been given much love and maintenance in prior years. As such, many functions/methods from those extensions don't properly validate their inputs, and sometimes even types.
Previously, it was customary that maintainers of bundled extensions had more leeway in making changes which might break the “standard” PHP BC promise. However, it has been repeatedly questioned that adding ValueError or TypeError cannot be done because it is a BC break.
We deem this position to be nonsensical as this is willfully allowing broken and buggy code to go into production while making it harder to debug.
Proposal
Exempt the type and value validation of input values to function/methods/properties from the BC Break policy.
This includes, but is not limited to:
- Adding
TypeErrors to check inputs are:- Of the correct type
- Array values are of the correct type
- Adding
ValueErrors to check inputs are:- Within a range
- Not empty
- Do not contain null bytes
- Are only composed of valid bitmask flags
- One of the expected enum like integer constants
- Array keys are all strings
- Array keys are all integers
Note that this list is non-exhaustive.
Vote
As per the voting RFC a yes/no vote with a 2/3 majority is needed for this proposal to be accepted.
Voting started on 2026-XX-XX and will end on 2026-XX-XX.