« ReflectionClass::isInstantiable
ReflectionClass::isInternal »

ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isInterface — このクラスがインターフェイスであるかどうかを調べる

説明

public function ReflectionClass::isInterface(): bool

このクラスがインターフェイスであるかどうかを調べます。

パラメータ

この関数にはパラメータはありません。

戻り値

クラスがインターフェイスの場合は、true を返します。 そうでない場合は、false を返します。

例

例1 ReflectionClass::isInterface() の基本的な使用例

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

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

上の例の出力は以下となります。

bool(true)

参考

関連キーワード:
ReflectionClass   インターフェイス   isInterface   SomeInterface   isInstantiable   isInternal   基本的   interface   interfaceMethod   dump   参考   isInstance   インスタンス
関連する関数・ページ:
reflectionclass.implementsinterface   reflectionclass.isinstance   reflectionclass.issubclassof   reflectionclass.getparentclass   reflectionclass.getinterfaces   reflectionclass.getinterfacenames