PHP.nl

Closure::fromCallable

Closure::fromCallable

Converts a callable into a closure

Closure **Closure::fromCallable** callable $callback

Create and return a new from given using the current scope. This method checks if the is callable in the current scope and throws a if it is not. anonymous functioncallback``callback``TypeError

Opmerking: > As of PHP 8.1.0, has the same semantics as this method. First class callable syntax

callbackThe callable to convert.

Returns the newly created or throws a if the is not callable in the current scope. Closure``TypeError``callback

Anonymous functionsFirst class callable syntax

Documentatie