Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128801 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 DC54D1A00BD for ; Thu, 9 Oct 2025 18:55:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1760036113; bh=aSSlFAE5JPYWDN7OICXIYdhy1n/D8lERgo0SZr1YHPk=; h=Date:From:To:In-Reply-To:References:Subject:From; b=S9j/xD9KkhV98xWgsP2WJtu3pBYIfAFtESxXjoRnfgR+Wc/hGQFl2VDcz/Gmel4tT 940+HHhUudBNfcmAdN3qKpg30mITo+OCxIeNRsCgX7tERBbtwL0qwmLKeLRKEC5Djg GY5Ld74aqAU/qJR/Is/FGcF9rDofGfFk9SUo/oKsU+oKB2190YWNrICPi7OKjFFQPy RUkBdPu5QInBs1r+j1blwZkmmpL+o6nh9wRWb+VQXAGKMrN8XlHOog1UVxlT21fdoq 4DWTR4uFJrO9e2qin+T+BVbCC8KWHwIX+v9+2yV9G/3/lhGz9ec2BzkYPZbzTSk0mk mwSoAhmuUR1Fw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1E023180532 for ; Thu, 9 Oct 2025 18:55:11 +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=-2.8 required=5.0 tests=BAYES_00,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-b2-smtp.messagingengine.com (fhigh-b2-smtp.messagingengine.com [202.12.124.153]) (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, 9 Oct 2025 18:54:58 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.stl.internal (Postfix) with ESMTP id 81D037A0062 for ; Thu, 9 Oct 2025 14:54:53 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Thu, 09 Oct 2025 14:54:53 -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=fm2; t=1760036093; x=1760122493; bh=8idLNp1FfPaancSvp9pCP ySkQ76vnP22/Qcx4qJFEPo=; b=OnJRzufn8XfnIsS0K87nJSqMUlRb9qM7MktgS 55GO71oDDzXzLWmql83dJ/OUUHJ3FuW7C/4xBpkR7Rr6TpPQJ2bu9zxmh2xjomTA QpeiLc8Z8AwRInDmpyzGiLD+5DVC9rChYqNVcyTza9FXkWkiBBpI/oGNXfFSlSZ9 EJ4qKlLEN8BPzAhDIbyjYCzpQfob2PacStW8BdbhtmDOAOKltK5rnkupkx/CA3Hg 3j94jd8LYxeIIFUE4Oj233J5epbSwoG7MRFIwZ4bvEjUYFKkVtkfNnM6Q1z/GyLM /4NHlRGz6tYbzI3Gg5Hs62+FzerHzW3zpviIZACik6zak1aMw== 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=fm2; t=1760036093; x=1760122493; bh=8 idLNp1FfPaancSvp9pCPySkQ76vnP22/Qcx4qJFEPo=; b=xhRDF1xZZj7KcqF2D avVIuNCkecz8tLqG9/b9y4ywBQVQPqAaPddmQ6C6mKdkDahN4I27UFbggGNIBdxE rmVhaM5X+vALW9N7ZRvwfEM36Lfue4hEpBjXwAJ5IFXxbr8Ww9e9BDFt8s9jAIaJ MZHyxVdTxbUR7XpW/ZsYMnW7X90vEc9UXN6KuEhbfrXf5gWg0NSN05PSVDjN3nKZ Ti/OaTfFPvF88Y+QKKiMsLBAn+MZ5UjiRiWo0FY9Cm+EerTZpbon53bNC/L4G4fY tGokQo0TJREpvDGc7z7H/xvzc2z/fJXIkovWYoBKHYEcNV5N0UtEn94zMP4gEas/ WCwug== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddutdeileehucetufdoteggodetrf 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 016B2700054; Thu, 9 Oct 2025 14:54:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: ATrodGnf_4Xg Date: Thu, 09 Oct 2025 13:54:32 -0500 To: "php internals" Message-ID: <13830641-0fb9-4de9-94ed-8873045ef820@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Partial Function Application v2 Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") On Sat, Jun 28, 2025, at 12:06 AM, Larry Garfield wrote: > Hi folks. Arnaud and I would like to present take-2 at Partial > Function Application. > > https://wiki.php.net/rfc/partial_function_application_v2 > > It is largely similar to the previous PFA proposal from 2021, though > there are a number of changes. Most notably: > > * The implementation is simpler, because FCC already did part of the > work. This RFC can build on it. > * Constructors are not supported. > * But optional arguments and named placeholders are supported. > * It includes pipe-based optimizations. > > Note: We realize that this is a non-trivial RFC coming late in the > cycle. We are proposing it now because, well, it's ready now. If the > discussion goes smoothly, we're OK calling a vote on it for 8.5, > especially as it would complement pipes so well. If the discussion > runs longer, we're also OK with targeting 8.6 instead. We'll see how > that goes. > > 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