- printf: documentation ( source)
<?php
class MetaReflectionClass extends ReflectionClass
{
// Deliberately chose IS_PRIVATE to demonstrate that it is not used by default
public function getMethods($foo = ReflectionMethod::IS_PRIVATE)
{
$args = func_get_args();
return call_user_func_array(
array('parent', 'getMethods'),
$args
);
}
}
$mrc = new MetaReflectionClass('DateTime');
printf("Number of methods (no filter): %s\n", count($mrc->getMethods()));
printf("Number of static methods: %s\n", count($mrc->getMethods(ReflectionMethod::IS_STATIC)));