Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127435 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 lists.php.net (Postfix) with ESMTPS id 5951C1A00BC for ; Fri, 23 May 2025 08:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1747987877; bh=dM2zhMV/lMgB7eHfoLFZOiGloCw6NMbRqWBAb7gDmnk=; h=Date:Subject:To:References:From:In-Reply-To:From; b=VR0WUBPsu/XheIgK22JI9pIK9MwH/tG+v3qj1prpUAy/yBHsUfER1/MkQQOCWY423 3t4O6f+eEFD9WHJqCPFHOHWHjuiErJDyqr64/Kq6PJwgY6xnGetrVXDkL4pLjfcdz9 3yev7VCKoF2KggBj4kJvUXSMdeH7Vhaydw/4qZ8n2SXVFm/OGPs/0fLltqgRkbWIv9 mS8+xK8fkrXX85A0uiL/Xl1K/lZ8gNOCPXICiPD1vKD7dnNzLKQhXmzWvIyadiRoZz Su2blLduL0XDnq+bqAep0xV1AJR0XYpm5f6v2yamfAm3YID/IAXPkyOgSTt8yjG0nA wQAyOVHhfMzbg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5DD7E1801D8 for ; Fri, 23 May 2025 08:11:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,DMARC_MISSING, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from emily.smtp.mailx.hosts.net.nz (emily.smtp.mailx.hosts.net.nz [43.245.52.179]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 23 May 2025 08:11:14 +0000 (UTC) Received: from 222-153-185-98-fibre.sparkbb.co.nz ([222.153.185.98] helo=[192.168.1.67]) by emily.smtp.mailx.hosts.net.nz with esmtpsa authed as varteg.nz (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim 4.96) (envelope-from ) id 1uINWm-00AC2Y-18 for internals@lists.php.net; Fri, 23 May 2025 20:13:16 +1200 Message-ID: <2f3650ce-9cff-4ea4-a9a6-cd0105061466@varteg.nz> Date: Fri, 23 May 2025 20:13:07 +1200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Forced named parameters To: internals@lists.php.net References: Content-Language: en-GB In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Hosts-DKIM-Check: none From: Weedpacket@varteg.nz (Morgan) On 2025-05-23 13:24, Anton Smirnov wrote: > Hi Alwin > > > Please explain the syntax you propose about this part: > > > That way, you could even make it so that only specific arguments are > required to be named > > because I see only 2 ways to call it: > >   #[AllArgsAreNamed] function f (/* ... */) > > and > >   function f($arg1, #[AllArgsAfterThisOneAreNamed] $arg2, $arg3) > > because > >   function f($arg1, #[NamedArg] $arg2, /* positional again */ $arg3) > > doesn't make sense, you cannot specify a positional argument after a > forced-named because it would be impossible to fill position 2 on the > function call. > Just chiming in, but I interpreted it as suggesting something like #[RequireNamedArgs('arg2', 'arg3')] function f($arg1, $arg2, $arg3)