ReflectionClass::implementsInterface
(PHP 5, PHP 7, PHP 8)
ReflectionClass::implementsInterface — 实现接口
说明
检查其是否实现了接口(interface)。
参数
interface
接口(interface)的名称。
错误/异常
如果 interface 不是接口,则
ReflectionClass::implementsInterface() 会抛出
ReflectionException。
参见
- ReflectionClass::isInterface() - 检查类是否是接口(interface)
- ReflectionClass::isSubclassOf() - 检查是否为子类
- interface_exists() - 检查接口是否已被定义
- 对象接口
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
