ReflectionClass::getInterfaces
(PHP 5, PHP 7, PHP 8)
ReflectionClass::getInterfaces — 获取接口
参数
此函数没有参数。
返回值
接口的关联数组,数组键是接口(interface)的名称,数组的值是 ReflectionClass 对象。
示例
示例 #1 ReflectionClass::getInterfaces() 示例
<?php
interface Foo { }
interface Bar { }
class Baz implements Foo, Bar { }
$rc1 = new ReflectionClass("Baz");
print_r($rc1->getInterfaces());
?>
以上示例的输出类似于:
Array ( [Foo] => ReflectionClass Object ( [name] => Foo ) [Bar] => ReflectionClass Object ( [name] => Bar ) )
+添加备注
用户贡献的备注
此页面尚无用户贡献的备注。
备份地址:http://www.lvesu.com/blog/php/reflectionclass.getinterfaces.php