- is_callable: documentation ( source)
<?php
class Foo {
static public $arr = array("test");
function bar( $str ){
if ( is_callable( self::$arr[0] ) ){
(self::$arr[0])( $str );
}
}
static function test($var) {
echo "Testing: $var\n";
}
}
(new Foo)->bar("bla");