<?php
class Testing
{
final public static function foo()
{
return;
}
public function bar()
{
return;
}
}
$foo = new ReflectionMethod('Testing', 'foo');
echo "Modifiers for method foo():\n";
echo $foo->getModifiers() . "\n";
echo implode(' ', Reflection::getModifierNames($foo->getModifiers())) . "\n";
$bar = new ReflectionMethod('Testing', 'bar');
echo "Modifiers for method bar():\n";
echo $bar->getModifiers() . "\n";
echo implode(' ', Reflection::getModifierNames($bar->getModifiers()));
?>
以上代码取自ReflectionMethod::getModifiers()
php 手册中的 Example #1 示例:http: //php.net/manual/en/reflectionmethod.getmodifiers.php
问题:代码:$foo->getModifiers()
,输出是261,这是什么意思?