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