×
FalconChen
2019-07-30 13:01
php判断成员函数的访问权限是public , https://www.php.net/manual/en/class.reflectionmethod.php #daily tips#
php 代码片断
<?php 
class Test{
    public function foo(){}
     
    private function bar(){}
}
$foo = new ReflectionMethod('Test', 'foo');
$s=Reflection::getModifierNames($foo->getModifiers());
print_r($s);
 
$foo = new ReflectionMethod('Test', 'bar');
$s=Reflection::getModifierNames($foo->getModifiers());
print_r($s);
0

暂无评论