Search Results
A valid callable array has 2 entries, the first of which is an object or a string, and the second a string. callable_name Receives the "callable name", e.g. "SomeClass::someMethod". Note, however, that despite the implication that SomeClass::someMethod() is a callable static method, this is not the case.
The is_callable () function checks whether the contents of a variable can be called as a function or not. This function returns true (1) if the variable is callable, otherwise it returns false/nothing.
Aug 17, 2010 · Put another way, is_callable is a wrapper for zend_is_callable, which handles variables with the pseudo-type callback, while function_exists only does a hash table lookup in the functions' table.
Jul 11, 2025 · The is_callable () function is an inbuilt function in PHP which is used to verify the contents of a variable can be called as a function. It can check that a simple variable contains the name of a valid function, or that an array contains a properly encoded object and function name.
The PHP Variable Handling is_callable () function is used to check if something can be used as a function. It is useful to know whether we can call a function before using it.
The is_callable function checks whether a value is callable (a function, method, or object with the __invoke magic method). Let's look at its operation with examples.
People also ask
What is is_callable function in PHP?
What is PHP variable handling is_callable() function?
How to check if a variable is callable in PHP?
How to check if a variable is callable?
Verify that a value can be called as a function from the current scope.
