3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function getMethods() { $class = new ReflectionClass($this); $methods = $class->getMethods(ReflectionMethod::IS_PROTECTED); print_r($methods); } } class Bar extends Foo { protected function privateFunction() {} // Not visible for parent::getMethods() } $Bar = new Bar(); $Bar->getMethods();

preferences:
37.64 ms | 402 KiB | 5 Q