ReflectionClass::getInterfaceNames

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

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

説明

public ReflectionClass::getInterfaceNames(): array

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

パラメータ

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

戻り値

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

例1 ReflectionClass::getInterfaceNames() の例

<?php
interface Foo { }

interface Bar { }

class Baz implements Foo, Bar { }

$rc1 = new ReflectionClass("Baz");

print_r($rc1->getInterfaceNames());
?>

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

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

参考