ReflectionMethod::getModifiers

(PHP 5, PHP 7, PHP 8)

ReflectionMethod::getModifiersErişim değiştiricileri döndürür

Açıklama

public ReflectionMethod::getModifiers(): int

Bu yöntem için erişim değiştiricilerinin bitsel toplamını döndürür.

Değiştirgeler

Bu işlevin değiştirgesi yoktur.

Dönen Değerler

Değiştiricilerin sayısal gösterimi. Bu değiştiricilerin güncel anlamları öntanımlı sabitler bölümünde açıklanmıştır.

Örnekler

Örnek 1 - ReflectionMethod::getModifiers() örneği

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

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

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

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

echo 
"bar() yönteminin değiştiricileri:\n";
echo 
$bar->getModifiers() . "\n";
echo 
implode(' 'Reflection::getModifierNames($bar->getModifiers()));
?>

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

foo() yönteminin değiştiricileri:
49
final public static
bar() yönteminin değiştiricileri:
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