Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP is_callable() Function

PHP is_callable() Function

PHP Available FunctionsAvailable PHP Functions

is_callable() The function is used to check whether a function is callable in the current environment.

is_callable() The function verifies whether the content of a variable can be used as a function call. This can check a variable containing a valid function name, or an array containing a correctly encoded object and function name.

PHP version requirement: PHP 4 >= 4.0.6, PHP 5, PHP 7

Syntax



bool is_callable ( callable $name [, bool $syntax_only = false [, string &$callable_name ]] )

Parameter Description:

Return Value

If name is callable, returns TRUE; otherwise returns FALSE.

Example

Example

The output is:



bool(true)

someFunction

bool(true)

someClass::someMethod

PHP Available FunctionsAvailable PHP Functions