- is_callable: documentation ( source)
<?php
class x {
function foo() {
print "\nfoo";
}
}
$x = new x();
$test = array($x, "foo");
echo is_callable($test) ? 'This is a callable' : 'This is not a callable';
echo "\n";
echo is_array($test) ? 'This is an array' : 'This is not an array';
$test();