array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'ja', ), 'this' => array ( 0 => 'reflectionclass.getinterfacenames.php', 1 => 'ReflectionClass::getInterfaceNames', ), 'up' => array ( 0 => 'class.reflectionclass.php', 1 => 'ReflectionClass', ), 'prev' => array ( 0 => 'reflectionclass.getfilename.php', 1 => 'ReflectionClass::getFileName', ), 'next' => array ( 0 => 'reflectionclass.getinterfaces.php', 1 => 'ReflectionClass::getInterfaces', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'ja', 'path' => 'reference/reflection/reflectionclass/getinterfacenames.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.2.0, PHP 7, PHP 8)
ReflectionClass::getInterfaceNames — インターフェイスの名前を取得する
この関数にはパラメータはありません。
インターフェイス名の配列を返します。
例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 )