Re: [RFC] Partial Function Application for instance of non-static methods ("$this")
| From: | Pierre Joye | Date: | Sun, 25 Jan 2026 12:51:31 +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-129918@lists.php.net to get a copy of this message | ||
Hi Tim,
On Thu, Jan 22, 2026 at 4:53 PM Tim Düsterhus <tim@bastelstu.be> 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
I really like that feature.
The syntax however, including some proposed in this thread, makes
little sense to me.
It is also challenging as it targets 8.6. I am not sure it is a good
idea to rush and make bad compromises with the syntax because of BC or
other issues due to the engine current state/behaviors.
I would rather wait for the next major and have a proper, self
explained syntax. Even if I doubt that "_" as function name will ever
be deprecated as well, that would be my favorite. The next would be
"it", as new keyword, $formattedDates =
array_map(DateTimeImmutable::format(it, "c"), $dates);
That could give some time to send some deprecation warning for "it",
as an example. Or whatever other symbols may be chosen. Or whatever
else would be needed to have a better approach that could last for the
next decade :).
best,
--
Pierre