Re: Consensus on argument validation for built-in functions
| From: | Jakub Zelenka | Date: | Fri, 11 Apr 2025 10:33:50 +0000 |
| Subject: | Re: Consensus on argument validation for built-in functions | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-127095@lists.php.net to get a copy of this message | ||
Hi,
On Tue, Mar 11, 2025 at 12:09 AM Jorg Sowa <jorg.sowa@gmail.com> wrote:
> Hello everyone,
>
> I’d like to align on the approach to validating arguments for built-in
> functions (usually for flag inputs). Some ongoing discussions in PRs:
> - https://github.com/php/php-src/pull/15647
> - https://github.com/php/php-src/pull/15883
> - https://github.com/php/php-src/pull/17859
>
> In some cases, changes introduced ValueError immediately in the next
> version, without a deprecation phase. To ensure a consistent approach, I
> propose the following:
>
> 1. Introduce a deprecation notice in the next minor version.
> 2. Raise a ValueError in the following minor version.
> If needed, I can create RFC, but as described by a few people in the
> discussions, we can avoid it having the consensus. What do you think?
>
>
I would personally prefer also go through the deprecation first to be on
the safe side.
This thread clearly shows that there is no consensus so I think the only
way forward would be to create a policy RFC to make decision about this
approach. Until then no PR introducing exception, deprecation or just plain
warning for this sort of things should be merged.
Kind regards
Jakub