ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isInterface檢查類是否是一個接口(interface)

說明

public ReflectionClass::isInterface(): bool

檢查類是否是一個接口(interface)。

參數(shù)

此函數(shù)沒有參數(shù)。

返回值

成功時返回 true, 或者在失敗時返回 false

范例

示例 #1 ReflectionClass::isInterface() 基本用法

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

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

以上例程會輸出:

bool(true)

參見