ReflectionClass::getInterfaceNames

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

ReflectionClass::getInterfaceNames获取接口(interface)名称

说明

public ReflectionClass::getInterfaceNames(): array

获取接口(interface)名称。

参数

此函数没有参数。

返回值

一个数值数组,接口(interface)的名称是数组的值。

范例

示例 #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
)

参见

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top