Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129864 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 30E261A00BC for ; Thu, 22 Jan 2026 16:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1769099780; bh=V/7R1Mg1C6aMthMem3IkGo9S27m9yiXj1udvmty41WI=; h=Date:From:To:In-Reply-To:References:Subject:From; b=Q+k6iECjha8TdD0wM9kG1W1ff35P8hKnH7OFlZk5seY17OTyKEKrgkZDhd64J/9El iKJBOUaNIDiS7zD/q2/2F8Hk1qb0Idj7vJQ2yvMSIpn1moCRe0xECaXzi8ITRoDhXy EnkxkjduFeONDWnvhmCtCv7VXSX5eaZLiNZtmD//nOFCET0L22oP9/PwUDsm+LqJen 5dXyCzuQvd14YH4IcbGcMb1VYk76QYSdPStDLRnZZthz5GH/sLF/gcciUo3NfgA1NI 0TY6cnwEM1fqZvHgW5/DiIbztaMVKHiXMKnfu9qdTNrBCAsw3vDu6p5H+JtuQTp4X4 yySPDV04w1bqA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 45B66180047 for ; Thu, 22 Jan 2026 16:36:20 +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.1 required=5.0 tests=BAYES_50,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-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Thu, 22 Jan 2026 16:36:20 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id E82591D0005D for ; Thu, 22 Jan 2026 11:36:14 -0500 (EST) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Thu, 22 Jan 2026 11:36:14 -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=fm2; t=1769099774; x=1769186174; bh=4PBXP4Zb5Z7e1nbguu8zQ eVeGN8FgbkixPpFYDKsnb8=; b=iWw9+aZ94+8RUTpqV1suxURtDbzi3vsgX/aUa 1kT1g3OphBL78WTZSxaXxjXPAeg34vzwLSayaVMLoYUP2ngFHsAUrFjYy9sqmhNZ 3HWOBVsr7qnjiA7zINzouAfGMpedisvYjq/AuDS0CeUSeJ5jiwSW0/2M4SfD9mYL 2L5O7o76TIi8DgW2UHbmqu7XNyG9kVZhuzKlASTLdNFMDfhvQmLlnZkYtKZ7MMZi bx5c4VqJjZ5ncxqHtaFTBNYVTgbn7KG8PbiXZGBYWnhHYpCjSRcXJe3TTvwgaD+F w1tx8q77Z8YvERgCtouCTX/nhBqoMXL2XUP1lXPsvqNNbTUBQ== 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=1769099774; x=1769186174; bh=4 PBXP4Zb5Z7e1nbguu8zQeVeGN8FgbkixPpFYDKsnb8=; b=EzxVKekNa2cvjXsDa 3Gxhvy7ckKtD2gALB9FmFmOXMDWQrjpaFnLcrwmGYPKeVaC/9NZj70QnV9hkQv70 YgK+wIy9/dybB+b7K+heIct/TG8MgQgeKP+Q4d5tXMlD8SR6VsV2s4zcj84JDztE PC4AXpxieGHv2jU+JrKvYjXcx6mQmUmeBDveMOjc3w9cwc3s0DXqIeLXeENy+76G CPrQnuEVaVchW9wMes03bO9WxugCUJzLIUfuJKdWcVddXIpd5iqzDbHsnxE1JgBF oHa4uUs0pOjNTyno7kFrA/2c2MUkhy8LhA5fwbDuvA3jQI1yvYNBvOTxfcLPY1vf 7mvYg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddugeeiieeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeeugfetieejueevffdulefhhfethfekvedtueevgfffvdef iedvtefgheevteelffenucffohhmrghinhepphhhphdrnhgvthenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehlrghrrhihsehgrghrfhhivghl ughtvggthhdrtghomhdpnhgspghrtghpthhtohepuddpmhhouggvpehsmhhtphhouhhtpd hrtghpthhtohepihhnthgvrhhnrghlsheslhhishhtshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 94D29700069; Thu, 22 Jan 2026 11:36:14 -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: Ap5THxlW55h7 Date: Thu, 22 Jan 2026 10:35:53 -0600 To: "php internals" Message-ID: <91952aa8-5d1e-401d-9f43-c812036e358f@app.fastmail.com> In-Reply-To: <28461544eb11b41dce7c7563ad879e63@bastelstu.be> References: <64953ec741a4c6609519e1878ad37b54@bastelstu.be> <253ee811-0c1d-7eab-4c36-38607401aaf6@php.net> <28461544eb11b41dce7c7563ad879e63@bastelstu.be> Subject: Re: [PHP-DEV] [RFC] Partial Function Application for instance of non-static methods ("$this") Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Thu, Jan 22, 2026, at 10:08 AM, Tim D=C3=BCsterhus wrote: > Hi > > Am 2026-01-22 16:33, schrieb Derick Rethans: >>> https://wiki.php.net/rfc/partial_function_application_this >>=20 >> We propose allowing a named parameter $this: ? to be combined with t= he >> =E2=80=9Cscope resolution operator=E2=80=9D syntax of referring to a= method. >>=20 >> I can't say I am entirely sold on the syntax here =E2=80=94 starting = with a $ >> makes it look like a variable. > > Yes, it certainly requires some getting used to it. It's the best we=20 > could come up with, but if there are any better suggestions, we're ope= n=20 > to hearing those. I'd like to note the =E2=80=9CRejected Features=E2=80= =9D section,=20 > since it lists some non-workable alternatives we considered. I too am very much in favor of this functionality, though not a fan of t= he syntax either. My previous, un-finished thinking was for `$$->foo('blah')`, which would= translate to a mixed fn that just forwards the call. I... hadn't actua= lly thought about also partially applying the method, since the use case= s I can think of would all be "call this method on the value piped from = the previous pipe step." (Or, read this property.) That would allow it= to be embedded within an array_map() call or similar, since it's techni= cally independent of both PFA and pipes. If it's being partially applied, then I don't see a way around the redun= dant typing, which is annoying. At least not without vastly better type= inference than we have today. So, I think I am mainly interested in the degenerate case where $this is= the only thing being partially applied, which seems like a common enoug= h case that it could have a nicer version? I'm just spitballing at this= point, I think. But I do like the direction. --Larry Garfield