PHP 8.1 – Callable syntax

linked dots structure
linked dots structure

Convert any callable into Closure object to be returned and then used/called when needed. The next syntax (aka First class callable syntax) of $this->methodName(...) is identical in behavior as current: Closure::fromCallable([this, 'methodName']). Do not confuse this syntax to unpacking argument syntax of ...$args.

Read morePHP 8.1 – Callable syntax