Re: [RFC] Partial Function Application for instance of non-static methods ("$this")

From: Date: Sat, 31 Jan 2026 04:21:12 +0000
Subject: Re: [RFC] Partial Function Application for instance of non-static methods ("$this")
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-129962@lists.php.net to get a copy of this message
Hey Tim, On 22.1.2026 10:50:26, Tim Düsterhus wrote:
Hi Arnaud and I would like to start discussion on our RFC “Partial Function Application for instance of non-static methods ("$this")” which is intended to round-off the Partial Function Application RFC that was accepted recently: https://wiki.php.net/rfc/partial_function_application_this Best regards Tim Düsterhus
I've been thinking about this RFC and I think it's a good addition. I just have one question: Why "$this: $obj" and not "this: $obj"? The variable in the function is "$this". Just like "$arg", which gets passed as "arg: $value", without the extra leading dollar-sign. (There's also no conflict, as you may not redeclare $this yourself in a non-static method.) When I see $<varname> before the colon, I sort of expect a dynamic parameter name, but it's not. Thanks, Bob

« previous php.internals (#129962) next »