get_declared_interfaces
(PHP 5, PHP 7, PHP 8)
get_declared_interfaces — 返回一个数组包含所有已声明的接口
说明
get_declared_interfaces(): array
返回一个数组包含所有已声明的接口。
返回值
本函数返回一个数组,其内容是当前脚本中所有已声明的接口的名字。
范例
示例 #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 )
参见
- interface_exists() - 检查接口是否已被定义
- get_declared_classes() - 返回由已定义类的名字所组成的数组
- class_implements() - 返回指定的类实现的所有接口。

User Contributed Notes
There are no user contributed notes for this page.
备份地址:http://www.lvesu.com/blog/php/function.get-declared-interfaces.php