- is_callable: documentation ( source)
<?php
function test($var) {
echo "Testing: $var\n";
}
class foo {
var $arr = "test";
function bar($str) {
echo is_callable( $this->arr )? 'yes' : 'no';
$this->arr($str);
}
}
$foo = new foo;
$foo->bar("bla"); // yes