Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:110843 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 38951 invoked from network); 4 Jul 2020 16:30:09 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Jul 2020 16:30:09 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E61A11804CF for ; Sat, 4 Jul 2020 08:20:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS11403 64.147.123.0/24 X-Spam-Virus: No X-Envelope-From: Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sat, 4 Jul 2020 08:20:05 -0700 (PDT) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 1321CE9A for ; Sat, 4 Jul 2020 11:20:05 -0400 (EDT) Received: from imap26 ([10.202.2.76]) by compute7.internal (MEProxy); Sat, 04 Jul 2020 11:20:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=AzFcmO fxwl+3afIX9lew66njXkw+U5WlHrC4FWojmJ0=; b=tL63ctLKgIlK4nNPeHhbQR GWJIlvbpIwiBZ0ZJwEkuFwfaL2HSc2CQs/xs7C203G1MbBwA8K0I9a9C/jL/YA97 QY3pgJTUxgFM6eoJWfnoJBrNT2ItgzO8957aHyObBJW6KJi1izYDKSO6hjPOUwC1 lZ86GeF2rzdYM0vMKLwwWoB621nTaTVS2B3jsQo7VIsDzumwzj2iqiGmmxxYJO9z AhaZ9lv4At4PHg3i+mjt5g1k0j92yn4G2DZ2L80hFFXq1k/hz8I3hIEGwyha4Knz tXsPGDA+cJ+dj26euZLp3N7DPTyX05Xg1acVLo/gZOj4c6rrezSxRq+ZUYNCDFBQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrtdekgdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsehttdertderredtnecuhfhrohhmpedfnfgrrhhr hicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomh eqnecuggftrfgrthhtvghrnhepveehhedvveejledvvefgleevffdtjeekledvkeegheff gfeivdejhffhledtudetnecuffhomhgrihhnpehphhhprdhnvghtnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgv lhguthgvtghhrdgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 3F9B214200A2; Sat, 4 Jul 2020 11:20:04 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-576-gfe2cd66-fm-20200629.001-gfe2cd668 Mime-Version: 1.0 Message-ID: <1ea0347c-b90a-4b0a-9a99-b4be19da8a0f@www.fastmail.com> In-Reply-To: References: Date: Sat, 04 Jul 2020 10:19:43 -0500 To: "php internals" Content-Type: text/plain Subject: Re: [PHP-DEV] Re: [RFC] Named arguments From: larry@garfieldtech.com ("Larry Garfield") On Fri, Jul 3, 2020, at 9:35 AM, Nikita Popov wrote: > I've made two additional changes to the proposal: > > 1. Explicitly mentioned attribute support in > https://wiki.php.net/rfc/named_params#attributes1, and added it to the > implementation (oops). ReflectionAttribute::getArguments() will also return > named arguments to the attribute, and ReflectionAttribute::newInstance() > will behave in the intuitive manner. > > 2. Added some information on internal APIs in > https://wiki.php.net/rfc/named_params#internal_apis. The tl;dr is that > named params are pretty much completely transparent for normal extensions, > but there are some additional APIs if for example you want to perform a > named param call from an extension. > > > In relation to this, I'm also considering to change the semantics of > call_user_func_array() to treat array elements with string keys as named > parameters, rather than simply ignoring keys. The motivation here is not so > much call_user_func_array() in particular, but various other APIs that do > the same thing, such as ReflectionMethod::invokeArgs(), which should all > behave consistently. That seems logical, although with the splat operator I don't know why anyone is using call_user_func_array() anymore to begin with. Still, consistency is a good thing. > Relatedly, I'm wondering if something like this should be allowed: > > call_user_func('strlen', str: 'foo'); Same statement: Seems logical, although why anyone is still using call_user_func() I don't know. :-) --Larry Garfield