日期:2014-05-17 浏览次数:20535 次
<?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);
------解决方案--------------------
http://cn.php.net/manual/en/class.reflectionmethod.php
------解决方案--------------------
反射的典型应用
------解决方案--------------------
http://www.php.net/manual/en/reflectionmethod.construct.php
一看就是反射,翻了翻就找到了这个。