Name
is_callable
Synopsis
int is_callable(callablecallback[, intlazy[, stringname]])
Returns true if
callback is a valid callback, false otherwise. To be valid,
callback must either be the name of a
function or an array containing two values—an object and the name of a
method on that object. If lazy is given and
is true, the actual existence of
the function in the first form, or that the first element in callback
is an object with a method named the second element, is not checked.
The arguments merely have to have the correct kind of values to
qualify as true. If supplied, the
final argument is filled with the callable name for the function—though in the case of the
callback being a method on an object, the resulting name in
name is not actually usable to call the
function directly.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access