Re: [RFC] Exempt input type and value validation from BC Break policy
| From: | Gina P. Banyard | Date: | Wed, 18 Mar 2026 12:20:18 +0000 |
| Subject: | Re: [RFC] Exempt input type and value validation from BC Break policy | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130389@lists.php.net to get a copy of this message | ||
On Monday, 9 March 2026 at 13:53, Kamil Tekiela <tekiela246@gmail.com> wrote:
> [...]
>
> I am, however, concerned about one thing. If we don't require RFCs
> there may be situations when a contentious validation is introduced.
> For example, many validations can be implemented in such a way that
> they don't cause additional performance loss, but let's say someone
> decides that validating the value provides more benefit than the
> performance cost. Without RFC, the community cannot share their
> feedback, and one person's opinion wins. But if the function is used
> with the correct values 99.99% of the time and it's used in the hot
> code, the performance cost isn't worth catching the accidental invalid
> value.
I don't think this concern is warranted in practice for at least 2 reasons:
- The majority of those functions are not going to be purely computational functions and are tied to
some I/O operation
- These input checking guards should be wrapped in UNEXPECTED() hinting to the CPU that they should
optimize for this branch not to be taken
Best regards,
Gina P. Banyard