Reflection::getModifierNames

(PHP 5, PHP 7, PHP 8)

Reflection::getModifierNamesDeğiştirici isimlerini döndürür

Açıklama

public static Reflection::getModifierNames(int $modifiers): array

Değiştirici isimlerini döndürür.

Değiştirgeler

modifiers

Döndürülecek değiştiricilerin bitsel VEYAlanmış değeri.

Dönen Değerler

Değiştirici isimlerini içeren bir dizi.

Örnekler

Örnek 1 - Reflection::getModifierNames() örneği

<?php
class Testing
{
    final public static function 
foo()
    {
        return;
    }

    public function 
bar()
    {
        return;
    }
}

$foo = new ReflectionMethod('Testing''foo');

echo 
"foo() yöntemi için değiştiriciler:\n";
echo 
$foo->getModifiers() . "\n";
echo 
implode(' 'Reflection::getModifierNames($foo->getModifiers())) . "\n";

$bar = new ReflectionMethod('Testing''bar');

echo 
"bar() yöntemi için değiştiriciler:\n";
echo 
$bar->getModifiers() . "\n";
echo 
implode(' 'Reflection::getModifierNames($bar->getModifiers()));

Yukarıdaki örnek şuna benzer bir çıktı üretir:

foo() yöntemi için değiştiriciler:
49
final public static
bar() yöntemi için değiştiriciler:
1
public

Ayrıca Bakınız

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top