ReflectionClass::isInterface()
(PHP 5, PHP 7)
检查类是否是一个接口(interface)
说明
public ReflectionClass::isInterface(void): bool
检查类是否是一个接口(interface)。
参数
此函数没有参数。
返回值
成功时返回TRUE
,或者在失败时返回FALSE
。
范例
Example #1ReflectionClass::isInterface()基本用法
<?php interface SomeInterface { public function interfaceMethod(); } $class = new ReflectionClass('SomeInterface'); var_dump($class->isInterface()); ?>
以上例程会输出:
bool(true)
参见
- ReflectionClass::isInstance() 检查类的实例