PHPTS:一键免费搭建 Nginx + PHP + MySQL 运行环境

ReflectionClass::isInterface

(PHP 5, PHP 7)

ReflectionClass::isInterface检查类是否是一个接口(interface)

说明

public ReflectionClass::isInterface ( void ) : bool

检查类是否是一个接口(interface)。

参数

此函数没有参数。

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

范例

Example #1 ReflectionClass::isInterface() 基本用法

<?php
interface SomeInterface {
    public function 
interfaceMethod();
}

$class = new ReflectionClass('SomeInterface');
var_dump($class->isInterface());
?>

以上例程会输出:

bool(true)

参见