文字

ReflectionClass::isInterface

(PHP 5)

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

说明

public bool ReflectionClass::isInterface ( void )

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

参数

此函数没有参数。

返回值

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

范例

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

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

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

以上例程会输出:

bool(true)

参见

  • ReflectionClass::isInstance() - 检查类的实例
上一篇: 下一篇: