Php/docs/reflectionclass.getinterfacenames

提供:Dev Guides
< Php
移動先:案内検索

ReflectionClass::getInterfaceNames

(PHP 5 >= 5.2.0, PHP 7)

ReflectionClass::getInterfaceNamesインターフェイスの名前を取得する


説明

public ReflectionClass::getInterfaceNames ( ) : array

インターフェイスの名前を取得します。


パラメータ

この関数にはパラメータはありません。


返り値

インターフェイス名の配列を返します。


例1 ReflectionClass::getInterfaceNames() の例

<?phpinterface Foo { }interface Bar { }class Baz implements Foo, Bar { }$rc1 = new ReflectionClass("Baz");print_r($rc1->getInterfaceNames());?>

上の例の出力は、 たとえば以下のようになります。


Array
(
    [0] => Foo
    [1] => Bar
)

参考