Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129008 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 2AA4C1A00BC for ; Thu, 30 Oct 2025 18:44:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761849898; bh=PiFT5T7GvD+HsO9yAlc3pU55SBXKqOMpDhc9uf8Ggnw=; h=Date:From:To:In-Reply-To:References:Subject:From; b=HuEYJLPSTlP2VkFGUn0mYwo0ocNdWxOGb78oRCoe72q9jo1o35BWBl9tTFwgKjhvW Nxn1iEZhLo9CrLO2f7MDPcQd5qglMX9DX1Yr92MgCFuTFMWltDB3fP2IynDVYsJHxn 4E+fQEDXG5FyCs8Lt4p2dTG82kaKeL1RgWDMeg4V4GqoEhbMcKJJJzVrTQF35EdXrO YFINCTjw7bWSrIwcqLwdkbA4rYpgmTwsdfdYiVUIuTO6hcozBsvEA6cy92tZCp/I1U vCi2BWkOFXT4U8t+/WVETdVDxg5XhvHPNh6EqahwWce9eOe9kJFUK3F1ZYlOjFK2pX IoLBYY8qJa+ig== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CF15A1801EE for ; Thu, 30 Oct 2025 18:44:57 +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=-1.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b5-smtp.messagingengine.com (fhigh-b5-smtp.messagingengine.com [202.12.124.156]) (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, 30 Oct 2025 18:44:57 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id ED6767A0182 for ; Thu, 30 Oct 2025 14:44:51 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Thu, 30 Oct 2025 14:44:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1761849891; x=1761936291; bh=Ec1/pCki8wMVDxAPGgbVq D31CmiL9yhIHKhu2DpeA2I=; b=a2rrGGmokB8T5rhmRotXGpJVPstBEuwAJgijn IsAVOQPDwRLzwpgVTTmq2ddvE40kgFE8XZw3nbgDPG0z/Dk3nbESzspDh1CfTJUT mj7Gfmjf2FEMnq2ihaZ88M59DE/cydJedcGc2ZDcO2qQAs33T9O0xq9gF2nQK0Nh /+tE5Ca6fuBPq3QR9XzFXJ4eVxhRGpKcCMEVwE/5OGD5jOrn9UhGU6OKrTK2k2ha zKRKMtuHbxXlaf2TigT/jTG+GHZAY7MTRp8H83DEOdKepSymbodZrC43tFpaa0Uv UnVmeDWD1RFpBvxYGSRxZPjV3M9KU3DhgGAf4XDqojvyZH/dw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1761849891; x=1761936291; bh=E c1/pCki8wMVDxAPGgbVqD31CmiL9yhIHKhu2DpeA2I=; b=NRq9km55eru10ekgM p1Dk43jKkGOh/V0g2lQ6MlJmHKnfsN02KrkZqVm7e0qRNELfi2G6FucvZXKsLwio DZ/rDxkjr5tykInMJClTep4dFuRpvghXA433Wm8Qf/WFpha4eZx+RHlmkq/zyeBP cDqb2759FbsclKFxZUL8PzmMycPqDcbUzmfNxjAGkMaJn7wevZ/q1r9rAPHNzNp3 bzf12iTNMJVAiNBSQYdSrgsV1KNjJUUZyHK0g53M6ZCPs85au9TrMfTiALqTAGMB EVayfBFBTx+SOYstWWFGcS3/SSVz/mqnWMoO2GP27yK8Cq7YdGqtdta87YFV6r6d GMXuQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdduieejfeeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthejredtredttdenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeeuvedvudfhffffhfelueehvdejvefgleegteegffetudef leehgeefvdehgeelteenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghl ughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 5D8D9700054; Thu, 30 Oct 2025 14:44:51 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ATrodGnf_4Xg Date: Thu, 30 Oct 2025 13:44:31 -0500 To: "php internals" Message-ID: In-Reply-To: <13830641-0fb9-4de9-94ed-8873045ef820@app.fastmail.com> References: <13830641-0fb9-4de9-94ed-8873045ef820@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC] Partial Function Application v2 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Thu, Oct 9, 2025, at 1:54 PM, Larry Garfield wrote: > Hi folks. PFA is back. :-) > > Since our last episode, Arnaud has greatly revised the implementation. > Rather than emulating a closure and all the associated behavior, the > new approach compiles PFAs into normal closures at runtime, leveraging > opcache. The resulting closure is then "just a closure," and will > behave like any other. That means, for instance, its behavior in > debugging, reflection, etc. is all self-evident. > > There were a few small behavior changes as a result, but not > dramatically. Mainly it impacted variadic cases, where parameter names > are now auto-generated when appropriate rather than simply being > unnamed. > > We have also changed the order of placeholders from "positional, > variadic, named" to "positional, named, variadic." Meaning the `...` > "and the rest" placeholder is always at the end of the call. > > One outstanding question is whether to allow reordering of parameters > in the PFA closure by using named arguments. With this implementation, > Arnaud says it's possible to do if we decide to. I am still concerned > that it would create too much complexity and confusion in practice. > But we're willing to go with a broad consensus if it emerges. > > https://wiki.php.net/rfc/partial_function_application_v2 > > --Larry Garfield Another set of updates. * Some improvements to the error handling and error messages. * Clarified that PFA is compatible with constant expressions. * Clarified when the resulting closure is static or not. The main change is we revisited how extra arguments are handled. Long story short, they now forward only if the PFA has a ..., and how they forward depends on if the underlying function is variadic or not. The RFC now includes more precise examples of how the desugaring works, including the variadic/func_get_args cases, which should make it all a lot clearer. The one outstanding question is whether we allow reordering using named arguments or preserve the underlying order. Arnaud says either one is doable. So far, only 2 people have commented on it (favoring reordering). We still want feedback from more people to see if there really is a consensus one way or another. (2 people is too small a sample size to draw any conclusions.) Also, if anyone not named Tim would like to weigh in, now is the time. :-) --Larry Garfield