There's definitely similarity, but I would say it sits somewhere between the two. Rather than reference a partial method call, or create a closure for a method, you're delaying a method call. Or rather, referencing a method. We have the ::class pseudo property, so I see this like an equivalent, but for methods.
On Mon, Jan 23, 2023, at 4:50 PM, Deleu wrote: > > > 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 > --- Best Regards, *Ollie Read*