Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122931 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 ED4271A009C for ; Thu, 4 Apr 2024 13:19:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712236824; bh=Tiq1GzHq4E5l88aXH1+mWopGDI6tV3lEz/YvaHXeOyo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=D4FeMKoKAo1dpmnjhzekbDB+QzVrfcOBAFCZajxCc9yxm5Aqn7HdXJrCgVwWEn3A7 zu4ArPY9se5UYV0+zWg96Y3B89FZ73aq9FGLsTGfPPX561c0U4zviOFAxNcpWwkcp9 Yi7euBuUa1IXxfS9e+nec36Zd6CUAXLslFkyd3jaHKfpXbn39LgcM7sgh9U04noYlj nahhzTx0PYFzSzzybehgZcGGprKipPaPs9HG3AKRtUpB12/x22AvhZo40uYPIwlSwA lknH/8WpTS00cVk6j/QEJgUmTFUXRz8t8jWgL1YOquC1HBOum8VVTdCp5t1FILpvxj 5M78fbBdJ77sg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 74893180636 for ; Thu, 4 Apr 2024 13:20:23 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,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-42aa.mail.infomaniak.ch (smtp-42aa.mail.infomaniak.ch [84.16.66.170]) (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 13:20:22 +0000 (UTC) Received: from smtp-3-0001.mail.infomaniak.ch (smtp-3-0001.mail.infomaniak.ch [10.4.36.108]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4V9Mfc0QDVzrBQ for ; Thu, 4 Apr 2024 15:19:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=uzy.me; s=20230717; t=1712236791; bh=Tiq1GzHq4E5l88aXH1+mWopGDI6tV3lEz/YvaHXeOyo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=UZrFsnVd00MHhQaex6ok+0Xm1CMeveLCDdAM+o52+e4yMKn2h9/1+tVBDCs7lwSg9 FSaL5i8iCSXedUyfWxyQ4RqJEikEwFalZG8fvy4OjDEzdNPlzWjT1y6JiuuyPZPH9X 6UkFNyhIotjHF9ZlU3Roy1R+wL050SdUgbVSgIqXr+GTkgXhBEPtsU6WUmxVJAswQ/ 7I4hQgorWLhcVkr6SnB9iWeuBgrJzWHMXg0dTcEe5tR3ymveeHXHabvSE22M7vkFYa T91GQ1LiO9DY3rSpUWIKRXu9TKDs5zdfqKp9JfQR9yDIPTWu2O+yQYPPiC7tHfgSYI GKAxA6+6AcYwA== Received: from unknown by smtp-3-0001.mail.infomaniak.ch (Postfix) with ESMTPA id 4V9Mfb5DL8zbDQ for ; Thu, 4 Apr 2024 15:19:51 +0200 (CEST) Content-Type: multipart/alternative; boundary="------------7ZUzwU8RKd0o0ADqwF6GeCGl" Message-ID: <2f3349e7-f10a-4907-844e-84e0b35f0fee@uzy.me> Date: Thu, 4 Apr 2024 15:19:51 +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> Content-Language: fr In-Reply-To: X-Infomaniak-Routing: alpha From: r@uzy.me (Pablo Rauzy) This is a multi-part message in MIME format. --------------7ZUzwU8RKd0o0ADqwF6GeCGl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Kamil, Le 04/04/2024 à 15:10, Kamil Tekiela a écrit : > Interesting proposal, but immediately I have two questions: > 1. Why is passing extra arguments a problem at all? Is generating a > warning a good idea? If you would like to introduce a new syntax to > enforce non-variadic functions, shouldn't it be a runtime error then? > Generating a warning makes it look like the new syntax still allows > for variadic arguments, but passing the extra arguments now is somehow > a bad thing to do. > 2. How does this affect func_get_args()? Will the function stop > working or continue working as before? 1. Indeed, if implemented it should be an error rather than a warning, you're right. 2. I don't see why func_get_args() should work differently, but that maybe my lack of knowledge of the internals of PHP. In any case I think it would be better if it worked the same. Regards, -- Pablo --------------7ZUzwU8RKd0o0ADqwF6GeCGl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Hello Kamil,

Le 04/04/2024 à 15:10, Kamil Tekiela a écrit :
Interesting proposal, but immediately I have two questions:
1. Why is passing extra arguments a problem at all? Is generating a
warning a good idea? If you would like to introduce a new syntax to
enforce non-variadic functions, shouldn't it be a runtime error then?
Generating a warning makes it look like the new syntax still allows
for variadic arguments, but passing the extra arguments now is somehow
a bad thing to do.
2. How does this affect func_get_args()? Will the function stop
working or continue working as before?

1. Indeed, if implemented it should be an error rather than a warning, you're right.

2. I don't see why func_get_args() should work differently, but that maybe my lack of knowledge of the internals of PHP. In any case I think it would be better if it worked the same.

Regards,

-- 
Pablo
--------------7ZUzwU8RKd0o0ADqwF6GeCGl--