Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128811 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 4AE8B1A00BC for ; Fri, 10 Oct 2025 15:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1760110162; bh=jTk8F3u8nSV3MGKAAfNnDwJQ1Kj2CJxBll1CBINdDE4=; h=Date:From:To:In-Reply-To:References:Subject:From; b=ccKMySI6Kb08jNaPslIHYMSrB1KEb7Y0wGd9WG9b9qoGW/98uakptVblzLrcg8Jmg HmZ7yoiVif7IoXb4kADU3W5r7RBzB9j1e8CaVrCUxEhl9K5d2psuMyl2LWGzuXr4aU MGQ6kA3CDj1vj3WAPglBW9jQKfKxJZjTfCBhQg1w7alg4O5ppWiomSb8OcYKmQWMx8 BgDZ+7aT1gpc7WpCDr3sa9PSWRflgdhOQ24/kPVWkuolUFXEfoVaxQQmqbODp0DwPl 8RjISnbN9ZCE6/K0s+NuLLR8ix5W61XGhtR+Hwthu8B8rOpttif5ChqGhs9dSngDkU beE/XuO/o5wnw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id EF6701801C7 for ; Fri, 10 Oct 2025 15:29:21 +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-a1-smtp.messagingengine.com (fhigh-a1-smtp.messagingengine.com [103.168.172.152]) (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 ; Fri, 10 Oct 2025 15:29:21 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 40F0F14000BA for ; Fri, 10 Oct 2025 11:29:16 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-10.internal (MEProxy); Fri, 10 Oct 2025 11:29:16 -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=1760110156; x=1760196556; bh=D1VEgwgJ27us6I61o0Ubd A8xIOoFFUamdrWNxB+2WH8=; b=S2dZXUSL2ka6Olve3mhnkxyNHIMSQsi2GZP0n pEMRWMdPozovfaEBi5pZfafZsJpk0qVwowckBJFOhoaBVeizlZoSaTIkSAkWWvQ0 Cro/V+2zaIa3k0Ju7mA7sAMg03g+82QolyaopiCNNzChA7uMgYjuj71wtw6tc//m wMjcHMxq2t7ajklJU5eWFi14FqbYugELLD2fpPIzdbuN3sCgUCt45Q42Dk73a6/r T4Hgbz+ne4nYyhlX48lzJ2rzvy5bUA1lPZ2r8efxE7Uy0Fb9OBO3J3gF4FTFu07z DuIqIqAPi3pIMmG9c4vnCuz1LQf8ffHXph/ZScX5oXH3n2T6w== 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=1760110156; x=1760196556; bh=D 1VEgwgJ27us6I61o0UbdA8xIOoFFUamdrWNxB+2WH8=; b=IAJl2T+pXooJU2eSD CxI8/EidneTGWwQ24bXxlr6bHAKGkiWIQuufqM3O2lx2/koHgai/UH7SpPvyn3Zh 1OWKy+RHIEz7z/uTovlKndxFCDEoa9q+dP+4jP5AMPgc/wACu3uXLCtHDXdm8i7P ZWlDwwP2VxRrhDu2SJY3diLSIwAXffMyzFXx6dIwZ87MIp6a6a1PVICruBpWtyD7 2QwS2aiURW2WcICnUMQMw6KgGfI9SOyEKQpPePCroUlQ1MCkGdbsjJRNODuKo2X8 RFmgcOQNzg701OsevL/ZioCauE9klZ4TqnsS5QDCRfNbm9s4VpwIU2AWTI+pavN7 6ibcQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddutdelgedvucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeffieeivdfhvdeguddttdegteeiueegvefhteehfeeffeet udeitdehtdegjeeuieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehlrghrrhihsehgrghrfhhivghlughtvggthhdrtghomhdpnhgspghrtghp thhtohepuddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsh eslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id CA018700063; Fri, 10 Oct 2025 11:29:15 -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: Fri, 10 Oct 2025 10:26:44 -0500 To: "php internals" Message-ID: In-Reply-To: References: <13830641-0fb9-4de9-94ed-8873045ef820@app.fastmail.com> Subject: Re: [PHP-DEV] [RFC] Partial Function Application v2 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Oct 9, 2025, at 4:39 PM, Tim D=C3=BCsterhus wrote: > I've given it another read. Remarks: > >> Positional placeholders that map to the variadic portion of the=20 >> underlying function will be named $args0, $args1, etc., and may be=20 >> called by name if desired. > > What will happen if the original function already has a parameter name= d=20 > $args0? It will skip over existing names. I've updated the text accordingly. >> Prefill all parameters, making a "delayed call" or "thunk" > > The example desugaring is inconsistent with the previously explained=20 > semantics: Here an arbitrary number of arguments is accepted, but=20 > previously it says "will result in a Closure with no parameters". Hm, I think that should probably read "no required parameters". It woul= d only make a difference if the underlying function had an optional vari= adic AND you called the thunk with extra, extraneous args. *Various typos fixed along the way* > ------ > > Questions: > > - Are PFAs legal in constant expressions? e.g. does the following work= :=20 > `const Foo =3D intval(?, 10);`? At the moment no, though Arnaud says that should be doable, with some re= asonable restrictions. (No variables, no variable callable name, etc.) > - The RFC says that it compiles down to the equivalent Closure. Can yo= u=20 > add an example of a stack trace for completeness? Ideally one with=20 > SensitiveParameter working. That will then showcase the closure naming= ,=20 > SensitiveParameters and that there are two stack frames for the call. > > Best regards > Tim D=C3=BCsterhus I've asked Arnaud to generate one for the RFC. --Larry Garfield