CakeFest 2024: The Official CakePHP Conference

ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

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

説明

public ReflectionClass::isInterface(): bool

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

パラメータ

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

戻り値

成功した場合に true を、失敗した場合に false を返します。

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

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

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

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

bool(true)

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top