Closure::fromCallable

(PHP 7 >= 7.1.0)

Closure::fromCallableConverts a callable into a closure

Description

public static Closure::fromCallable(callable $callback): Closure

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

Note:

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

Parameters

callback

The callable to convert.

Return Values

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

Here you can write a comment


Please enter at least 10 characters.
Loading... Please wait.
* Pflichtangabe
There are no comments available yet.

Total Commander 11.00 (final) is available! What's new?

Total Commander, a popular file manager, has recently released its latest version, 11.00. With a variety of new features and corrections, this version offers users an enhanced and optimized experience. ...

admin

Autor : admin
Category: Software-Updates

Which technologies should a PHP programmer master?

In today's digital world, the role of a PHP programmer is of great importance. ...

admin

Autor : admin
Category: Miscellaneous

PHPUnit version 10 released

PHPUnit version 10 released

Version 10 of the popular test framework PHPUnit has been released and is available for download. ...

TheMax

Autor : TheMax
Category: Software & Web-Development

Publish a tutorial

Share your knowledge with other developers worldwide

Share your knowledge with other developers worldwide

You are a professional in your field and want to share your knowledge, then sign up now and share it with our PHP community

learn more

Publish a tutorial