|
is_callableVerify that a value can be called as a function from the current scope Description
bool is_callable(mixed
$value , bool $syntax_only = false , string &$callable_name = null )
Verifies that Parameters
Return Values
Returns Examples
Example #1 Checking whether a string can be called as a function
The above example will output: bool(true) string(12) "someFunction" Example #2 Checking whether an array can be called as a function
The above example will output: bool(true) string(21) "SomeClass::someMethod" Example #3 is_callable and constructors
Despite the fact that constructors are the methods that are called when
an object is created, they are not static methods and
is_callable will return
The above example will output: bool(false) bool(false) bool(true) Notes
See Also
|