Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129283 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 587B41A00BC for ; Mon, 17 Nov 2025 17:09:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763399350; bh=gCCLPLlZPJL2UK8zUMGXGsDo9axXHzrS0N5FYMFg3lw=; h=Date:From:To:In-Reply-To:References:Subject:From; b=kQk/ufF9og6vzHUgQTQsxoOHM6S2QJENKOnxEHeCStBmzwgKofbIHulfeu7S54Vko XBgQ/HkRPWlO7nCgN0vuS032kXaZvnnOF43qbJ30d8KPTGnqJkyq9BGnjSvULXJRDj k/j8A0PoP/ypaz3kiLJYSkNDrXraAfr+Z95KV5fnMnLJNQXqSBBcu7qkv0MPc6rJ27 +FOhC0+JWg+BWFNOWZ6n+DN9KeLXZ3a6x1XnsSfelTQ9g96AF6dHDz4JX4ODSLGc12 Jcw/Jj3zbLNo589BJiyVs5lJowQQdxTTdOa76OBRoD/KMpHao756mxRXGByKe6nY/L c13uaH+CZ/G0g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E741418033A for ; Mon, 17 Nov 2025 17:09:09 +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.9 required=5.0 tests=BAYES_20,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 fout-a5-smtp.messagingengine.com (fout-a5-smtp.messagingengine.com [103.168.172.148]) (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 ; Mon, 17 Nov 2025 17:09:09 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 454AAEC037D for ; Mon, 17 Nov 2025 12:09:04 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Mon, 17 Nov 2025 12:09:04 -0500 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=1763399344; x=1763485744; bh=Xm/RiaeYmkwRVzk+3PZWF QcJD4hkhp0KRU1YxTZA9mQ=; b=MuBsFO1El/WwoQQij1cDODwG91CQomB2N8bRY ezKNM63oNDINqYTQ095aNjnIyVna7EApFTxGKVS9o2UOofwxczZiqn5Z51mf89w6 OQmTrr7RLlU98e7gBuqr5AP67LauSX/mfeaAWph9Yd8BcIIWN/ZlGpaFbh4/xRft o3mDaDsOrB0hb1drlTu5U0BMdEu6ORRKmmWYJj/IxtnaIG8Fz/Tzv3XvOTG8koCH CENSwoCpSrmdwqqJ+qTLwUP2JDLKhi+we3YTkDD/7pjF45Rbt7vZ9FNByAhAgUQh Nuz8G4PEbbJkjZlBiclFn7Jq+lMUaNXbZzRpPRGYkPc9N1OgA== 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=1763399344; x=1763485744; bh=X m/RiaeYmkwRVzk+3PZWFQcJD4hkhp0KRU1YxTZA9mQ=; b=i0vj5HDNjSbQqUBHk RS4E3POaUzgtpahdiS/7ocvDCB6pHHXxEng777SUbT9vtyXkqiSMT+WXGV22oejM jCNZugqn1/EvKMj9mIzb176JRcFwiJUufpp7SbTgK2jpp/GJobsD8t/JRl9o9TMc 4kWBwFI+2BB7Qe9h2PVMMG5KtYOABUlHLmZEUqAG6o43ysYJyAfmHeiF5pNl3s7l 1zOHy6SPFlJMvbFJXqdYkwx8u4Q6X95yeh97reiduwqpMR/nVsTVS1fBTZh+I528 yPRYZ2+tGPTMOKHbFBBP7rerg+d7OGCc9MogNwQ5Eil8JLU4uFPC0DwPmkMFElul hWiuw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddvudeltddvucetufdoteggodetrf 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 0BDD3700063; Mon, 17 Nov 2025 12:09:04 -0500 (EST) 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: Mon, 17 Nov 2025 11:08:17 -0600 To: "php internals" Message-ID: <9b72757b-6071-4df5-9efd-8c0c0390f571@app.fastmail.com> In-Reply-To: References: <2d6318f2-bd79-4aeb-a5b2-9db9367a8f27@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 Mon, Nov 17, 2025, at 10:26 AM, Bob Weinand wrote: > Hey Larry, > > On 16.11.2025 21:51:59, Larry Garfield wrote: >> 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. >>> >>> >> It's been just over 2 weeks since the last comment in the thread, and the last change was made (allowing for parameter reordering). Please consider this the Intent to Vote post; I'll be calling the vote sometime probably late Tuesday or on Wednesday, baring any new issues before then. >> >> --Larry Garfield > > I've just gave the RFC another deep read, and found only mentions of > pass-by-ref. But not return-by-ref, and neither does the implementation > handle this case: > > # ./sapi/cli/php -r 'function &r(&$a) { return $a; } $a = 1; $b = > &r($a); ++$b; var_dump($a);' > int(2) > # ./sapi/cli/php -r 'function &r(&$a) { return $a; } $a = 1; $b = > &r(?)($a); ++$b; var_dump($a);' > > Notice: Only variables should be assigned by reference in Command line > code on line 1 > int(1) > > Was this an oversight or intentionally omitted in the RFC? If it was, > I'd like to hear the reasoning on this. Just an oversight. We both use return-by-ref so rarely we forgot it's even a thing. :-) I've updated the RFC to include it, and Arnaud said it's easy to update the implementation so will do so shortly. Thanks for the catch. As this is largely just a forgotten case (I just added a "/return-by-ref" to the text), I'm not sure if it needs a cooldown reset. For the moment I will plan to continue opening the vote in the next few days, but if someone requests it I'll mark it a minor change and delay a week. --Larry Garfield