The is_callable() function is used to detect whether the function is callable in the current environment.
The is_callable() function verifies whether the contents of a variable can be called as a function. This can check for a variable containing a valid function name, or an array containing a correctly encoded object and function name.
PHP version requirements: PHP 4 >= 4.0.6, PHP 5, PHP 7
bool is_callable ( callable $name [, bool $syntax_only = false [, string &$callable_name ]] )
Parameter description:
$name: The callback function to check.
$syntax_only: If set to TRUE, this function only verifies that name may be a function or method. It simply rejects non-characters, or does not contain a valid structure that can be used in the callback function. Valid should contain two elements, the first is an object or character, and the second element is a character.
$callable_name: Accepts "callable_name".
Returns TRUE if name is callable, otherwise returns FALSE. .
The output is:
bool(true)someFunctionbool(true)someClass::someMethod