Re: Consensus on argument validation for built-in functions

From: 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 [email protected] to get a copy of this message
Hi,

On Tue, Mar 11, 2025 at 12:09 AM Jorg Sowa <[email protected]> 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


Thread (16 messages)

« previous php.internals (#127095) next »