array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'reflection.getmodifiernames.php', 1 => 'Reflection::getModifierNames', ), 'up' => array ( 0 => 'class.reflection.php', 1 => 'Reflection', ), 'prev' => array ( 0 => 'reflection.export.php', 1 => 'Reflection::export', ), 'next' => array ( 0 => 'class.reflectionclass.php', 1 => 'ReflectionClass', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/reflection/reflection/getmodifiernames.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5, PHP 7, PHP 8)
Reflection::getModifierNames — 修飾子の名前を取得する
modifiers
取得する主食師のビットフィールド
修飾子の名前の配列を返します。
例1 Reflection::getModifierNames() の例
<?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()));
上の例の出力は、 たとえば以下のようになります。
Modifiers for method foo(): 261 final public static Modifiers for method bar(): 65792 public