I am working on a project, in which I am using a deprecated function from the older version. But don\'t want my script to stop if used in the older version.
So I am check
The function is_callable accepts not only function names, but also other types of callbacks:
Foo::method
array("Foo", "method")
array($obj, "method")
So is_callable
accepts anything that you could pass call_user_func and family, while function_exists only tells if a certain function exists (not methods, see method_exists for that, nor closures).
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.