ReflectionClass::implementsInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::implementsInterface实现接口

说明

publicReflectionClass::implementsInterface(ReflectionClass|string$interface): bool

检查其是否实现了接口(interface)。

参数

interface

接口(interface)的名称。

返回值

成功时返回 true, 或者在失败时返回 false

错误/异常

如果 interface 不是接口,则 ReflectionClass::implementsInterface() 会抛出 ReflectionException

参见

To Top