On Thu, May 20, 2021, 15:48 Nikita Popov <nikita....@gmail.com> wrote:
> Hi internals, > > I'd like to present an RFC for a first-class callable syntax, which is > intended as a simpler alternative to the partial function application (PFA) > proposal: > > https://wiki.php.net/rfc/first_class_callable_syntax > > This looks good to me. Following some discussions, I understand how this syntax was proposed. Maybe update also the PFA RFC to be up to date with the latest info. Also, considering the resolution between property and method (or between constants and static methods) , it's clear that we need a syntax that looks like the usual invocation:(...), or (?), (...?), ($), ($$), (...$) etc. I have few question related to some behavior. If we have closure: $c = function() {}; Will this be true? $c(...) === $c; similarly with how it happens for Closure::fromCallable($c) === $c; since the RFC makes a lot of comparisons between them. Also, from performance point of view, do we expect the new syntax to behave similarly? And another not practical one: Will this be valid? $c(...)(...)(...)(...)(); Regards, Alex