- print_r: documentation ( source)
<?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();