Classes/Object 函数
PHP Manual

get_declared_interfaces

(PHP 5)

get_declared_interfaces返回一个数组包含所有已声明的接口

说明

array get_declared_interfaces ( void )

本函数返回一个数组,其内容是当前脚本中所有已声明的接口的名字。

Example #1 get_declared_interfaces() 例子

<?php
print_r
(get_declared_interfaces());
?>

以上例程的输出类似于:

Array
(
    [0] => Traversable
    [1] => IteratorAggregate
    [2] => Iterator
    [3] => ArrayAccess
    [4] => reflector
    [5] => RecursiveIterator
    [6] => SeekableIterator
)

参见 get_declared_classes()

返回值

Returns an array of the names of the declared interfaces in the current script.

范例

Example #2 get_declared_interfaces() example

<?php
print_r
(get_declared_interfaces());
?>

以上例程的输出类似于:

Array
(
    [0] => Traversable
    [1] => IteratorAggregate
    [2] => Iterator
    [3] => ArrayAccess
    [4] => reflector
    [5] => RecursiveIterator
    [6] => SeekableIterator
)

参见


Classes/Object 函数
PHP Manual