php 怎样获取类的成员方法访问权限
class demoClass()
{
public function pub()
{
}
private function pr()
{
}
}
$reflection = new ReflectionMethod('demoClass', 'pub');
$result = Reflection::getModifierNames($reflection->getModifier());
print_r($result);
//array('public',)
$reflection = new ReflectionMethod('demoClass', 'pr');
$result = Reflection::getModifierNames($reflection->getModifier());
print_r($result);
//array('private',)