« ReflectionClass::getFileName
ReflectionClass::getInterfaces »

ReflectionClass::getInterfaceNames

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

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

説明

public function 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
)

参考

関連キーワード:
ReflectionClass   インターフェイス   getInterfaceNames   getInterfaces   interface   getFileName   implements   print   参考
関連する関数・ページ:
reflectionclass.getinterfaces   reflectionclass.getfilename   reflectionclass.implementsinterface   reflectionclass.issubclassof   reflectionclass.getparentclass   reflectionclass.isinterface