Re: Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically
| From: | Deleu | Date: | Mon, 23 Jan 2023 16:50:11 +0000 |
| Subject: | Re: Introduce the abiltiy to use the first-call-callable syntax on non-static methods, statically | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-119400@lists.php.net to get a copy of this message | ||
On Mon, Jan 23, 2023, 1:16 PM Ollie Read <php@ollie.codes> wrote:
> Oh, I didn't mean to suggest that it automatically binds.
>
> My second suggestion for how to achieve this does require some sort of
> automation. If you create a closure from Str::someMethod($arg1, $arg2)
> where someMethod isn't static, it should create a closure with the
> signature fn(Str $object, $arg1, $arg2), which would wrap a call to
> [$object, 'someMethod]($arg1, $arg2).
I think this starts to wonders in the realm of Partial Function Application
https://wiki.php.net/rfc/partial_function_application