downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

ReflectionClass::getMethod> <ReflectionClass::getInterfaceNames
[edit] Last updated: Fri, 25 May 2012

view this page in

ReflectionClass::getInterfaces

(PHP 5)

ReflectionClass::getInterfacesインターフェイスを取得する

説明

public array ReflectionClass::getInterfaces ( void )

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

パラメータ

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

返り値

インターフェイスの連想配列を返します。インターフェイス名が連想配列のキー、対応する値が ReflectionClass オブジェクトとなります。

例1 ReflectionClass::getInterfaces() の例

<?php
interface Foo { }

interface 
Bar { }

class 
Baz implements FooBar { }

$rc1 = new ReflectionClass("Baz");

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

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

Array
(
    [Foo] => ReflectionClass Object
        (
            [name] => Foo
        )

    [Bar] => ReflectionClass Object
        (
            [name] => Bar
        )

)

参考



add a note add a note User Contributed Notes ReflectionClass::getInterfaces
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites