3v4l.org

run code in 300+ PHP versions simultaneously
<?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)));

preferences:
34.83 ms | 402 KiB | 5 Q