Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122942 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 5F3931AD8EA for ; Thu, 4 Apr 2024 21:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712264453; bh=5o01hSExyhkISPEivihzBQKnYiR906kW6avo8tdqq0w=; h=Date:Subject:To:References:From:In-Reply-To:From; b=dX/2wEDYdsiYqOS7TNymTDiZ1ru3soeTfUE6f0wzgbP0kc+46T4enfN+ovMd16tRc /Wq4oKWOn6z8a/DbcWR4hVJa3gY/mwAQZNt5LTQ5qa9IPiVTeWwAL9t98fXIQPJsvC 2eNl3INtJCSxFsGLuJkrSgNc/QPyctSxEKM7HUoEzHrMkZ6X4uU2qfttC8mwqU4zpU qd0+3QuURckHfusFMI+nQlw3uDBbD2xuUgiN3P0qAfKzyOsPb82BfjXX6PH42GllDg avAvwtXqGK+OrW4jLp5v8EK1ekU8tRNOFm7PjDQ8meP28AcCnXLqEbeXjcqaRMRIPu hVEEKAaoB1drw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 016EA1801DC for ; Thu, 4 Apr 2024 21:00:50 +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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from smtp-bc08.mail.infomaniak.ch (smtp-bc08.mail.infomaniak.ch [45.157.188.8]) (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 ; Thu, 4 Apr 2024 21:00:48 +0000 (UTC) Received: from smtp-3-0000.mail.infomaniak.ch (smtp-3-0000.mail.infomaniak.ch [10.4.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4V9Yss61dfzDwW for ; Thu, 4 Apr 2024 23:00:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uzy.me; s=20230717; t=1712264417; bh=5o01hSExyhkISPEivihzBQKnYiR906kW6avo8tdqq0w=; h=Date:Subject:To:References:From:In-Reply-To:From; b=OQ6YsA6Y+Kf6gXLPVxfq2sKmC0veSbu1/yzVTJQmVAj0Ii9gp+Id+bLkmP68V4nDW x5iZtHXoumZ1kJHEvOiOOr8CYYzEzqu6pNtSXIof6nNmdJ33Gkyuf895VKGmGz3UYg Sho8OzbmWKm38G2na0rul9eEitI1O7Umrzg3aAf2Jmj1d/0u+J1kDobFxmj3pgAFZj q7WO1+WtMU8X+KC5TKKxwTryvaGY7nA3sAFy3vbagBjiOIHIIazPPazWv6/Qge1H3/ pqzr8hhmzu7bKoi+4XELVxBcsW/SydiczoUXD/PifKv7IsrZ90erZOOPCToDauDY04 M+sNYdfLqsqIw== Received: from unknown by smtp-3-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4V9Yss3Nlgz4jt for ; Thu, 4 Apr 2024 23:00:17 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------87gBhugWLLCp47AgsoMFrkQY" Message-ID: <07d3168c-f8dc-4b2c-9eef-eacef8a0812c@uzy.me> Date: Thu, 4 Apr 2024 23:00:16 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] RFC idea: using the void type to control maximum arity of user-defined functions To: internals@lists.php.net References: <6299b649-c19b-4172-9632-2ef0a55d256d@uzy.me> <7B32AF65-CA40-40F5-BA59-CB5180EC4D7F@gmail.com> <8f71d807-78e6-49f6-acc7-b1fc09d815ba@uzy.me> <989e3e13-48ee-4970-8485-f79bb70ad37c@bastelstu.be> Content-Language: fr In-Reply-To: <989e3e13-48ee-4970-8485-f79bb70ad37c@bastelstu.be> X-Infomaniak-Routing: alpha From: r@uzy.me (Pablo Rauzy) This is a multi-part message in MIME format. --------------87gBhugWLLCp47AgsoMFrkQY Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 04/04/2024 à 17:57, Tim Düsterhus a écrit : > Hi > > On 4/4/24 16:36, Pablo Rauzy wrote: >> I strongly agree in theory, but this could break existing code, and >> moreover such a proposal was already rejected: >> https://wiki.php.net/rfc/strict_argcount > > The RFC is 9 years old by now. My gut feeling is be that using an > actual variadic parameter for functions that are variadic is what > people do, because it makes the function signature much clearer. > Actually variadic parameters are available since PHP 5.6, which at the > time of the previous RFC was the newest version. Since then we had two > major releases, one of which (7.x) is already out of support. > > I think it would be reasonable to consider deprecating passing extra > arguments to a non-variadic function. Well, if there is a consensus to agree on that, it would be even better! Cheers, -- Pablo --------------87gBhugWLLCp47AgsoMFrkQY Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Le 04/04/2024 à 17:57, Tim Düsterhus a écrit :
Hi

On 4/4/24 16:36, Pablo Rauzy wrote:
I strongly agree in theory, but this could break existing code, and
moreover such a proposal was already rejected:
https://wiki.php.net/rfc/strict_argcount

The RFC is 9 years old by now. My gut feeling is be that using an actual variadic parameter for functions that are variadic is what people do, because it makes the function signature much clearer. Actually variadic parameters are available since PHP 5.6, which at the time of the previous RFC was the newest version. Since then we had two major releases, one of which (7.x) is already out of support.

I think it would be reasonable to consider deprecating passing extra arguments to a non-variadic function.

Well, if there is a consensus to agree on that, it would be even better!

Cheers,
-- 
Pablo
--------------87gBhugWLLCp47AgsoMFrkQY--