Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127095 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 2405C1A00BC for ; Fri, 11 Apr 2025 10:34:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1744367500; bh=q6Z9xJW7DnN42ZO6hWQPBlaP+u96zB11AlO/33ywZGk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=eqcBOdTT4GIGwRzfD+wximYiwnfILgcx+S6dvFUIpKC1p9V1tMrCju4VWEQ4pznaV en8q0PpBxVizqfbbAE7pwAUmz4nLsGm1G3HPoODeD0u/xGSuQNEVSCPX3NhsOR12ZT CtJ6OhIRuBSVPZipRxzyK+gSHJnv5OFB5f8srgLlBP/4PWqpd9TIhvA7ZJdC16gpOT 06RhRId4M/O8nvCdAng/doQFW/ZLY8n26Ic+VJES3xTg7Fgzk0OGwQYQpGT60/X5kU Cpv5MP4edpOErOwKps+JUh+lz0Q3NmnbXt/FHQmJLp43bIxo/CiqIAwodR7Km8gXEW 7MEO2Te4SWh9w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 74498180053 for ; Fri, 11 Apr 2025 10:31:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 11 Apr 2025 10:31:39 +0000 (UTC) Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-601c469cce3so483132eaf.2 for ; Fri, 11 Apr 2025 03:34:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744367642; x=1744972442; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q6Z9xJW7DnN42ZO6hWQPBlaP+u96zB11AlO/33ywZGk=; b=vnLPklg8czhYoBgWtoXWKAog2553nHFCM8vk9pIh8N26K4GMWe65vRF0jR3ArrMrGd 2bknqTQ2ZQUZKNQeF9RBQ+OP6skOCMv9db+vZdK/tAkrSyNkeFWQXG+UwvXgVQxbbT0p Lg6GNSxbEpLPDPiwmKj1cknLh+yN05DWumT8ZgyBXH3Q1ZMzowbwcqSMoQo4fpnQT9S0 Z6j508trdB9QrnRDAAN3o1j8p6xIJRWjVpj/tL8B1MXmOfV8VBfbDiZk3AhLVNYCK0SF 4h0PXP8e2jlC74oN1Js0ec1Pvo9n8WBL+D9M6PZ3VpEQe7CYjYQQhA+6l7Tm7XP0sjpB 66/Q== X-Gm-Message-State: AOJu0YwkK/GVekhB31o5oHqsX6US1y9yRvr9nVn4it8ujjOiONQQ0hFE 7jP4k+xHtkTX57Gh7bk/auTiZ/fn3DAWy7o1JaTxMlgtPF3xd+Pq+d1oHLiz7YQjps3zMmddyHI QvzQ0SN6f/N/RfAPJLnb2aKwxgKc= X-Gm-Gg: ASbGnctr1Tn/ciA3G4AbBQD8vNOlcznBZarMM15IU8RH5+3iPRaUJD+lg8ROw/TqS0S ckf5s+fH+BTIx9xYu8xsq7oDTLysv4VvF+BtRFG78gJsCvd7cx1pM1zsq7HGnJGFOKDKIUDA9j1 3LF1Z3KacRiXWi0J9KehGo X-Google-Smtp-Source: AGHT+IFB9XPSUvnInoLMZb3VCry+97nI4fSm7dEflnwW/vLF6/OTthfLVd9TfJzrrlDl6saf4+sQhWsmiZTuzDfLzXs= X-Received: by 2002:a05:6820:1392:b0:5fe:9edb:eafe with SMTP id 006d021491bc7-6046f59b8a9mr1095858eaf.5.1744367641983; Fri, 11 Apr 2025 03:34:01 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 11 Apr 2025 12:33:50 +0200 X-Gm-Features: ATxdqUF4FCiRkfi9rh9nD1DGR-9Ph-P8n3ieF4dGoLD3EFJwYA8-bOY41gjl_6g Message-ID: Subject: Re: [PHP-DEV] Consensus on argument validation for built-in functions To: Jorg Sowa Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000a8842306327e3d5f" From: bukka@php.net (Jakub Zelenka) --000000000000a8842306327e3d5f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Mar 11, 2025 at 12:09=E2=80=AFAM Jorg Sowa wr= ote: > Hello everyone, > > I=E2=80=99d like to align on the approach to validating arguments for bui= lt-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 --000000000000a8842306327e3d5f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Tue, Mar 11, 2025 at 12:0= 9=E2=80=AFAM Jorg Sowa <jorg.sowa= @gmail.com> wrote:
Hello everyone,

I=E2=80=99d like to align on the approach to validating arguments for bu= ilt-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 immediat= ely in the next version, without a deprecation phase. To ensure a consisten= t approach, I propose the following:

1. Introduce a deprecation noti= ce in the next minor version.
2. Raise a ValueError in the = following minor version.

If needed, I can create RFC, but as described b= y a few people in the discussions, we can avoid it having the consensus. Wh= at do you think?


I would personally prefer also go through the deprecation first to be on t= he safe side.

This thread clearly shows that there= is no consensus so I think the only way forward would be to create a polic= y RFC to make decision about this approach. Until then no PR introducing ex= ception, deprecation or just plain warning for this sort of things should b= e merged.

Kind regards

Ja= kub
--000000000000a8842306327e3d5f--