ReflectionClass::isInterface
(PHP 5, PHP 7, PHP 8)
ReflectionClass::isInterface — 检查类是否是接口(interface)
参数
此函数没有参数。
示例
示例 #1 ReflectionClass::isInterface() 基本用法
<?php
interface SomeInterface {
public function interfaceMethod();
}
$class = new ReflectionClass('SomeInterface');
var_dump($class->isInterface());
?>以上示例会输出:
bool(true)
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
