ReflectionClass::isInterface
PHP Manual
PHP Manual»ReflectionClass»ReflectionClass::isInterface

ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isInterfaceChecks if the class is an interface

Опис

public function ReflectionClass::isInterface(): bool

Checks whether the class is an interface.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

Returns true if the class is an interface or false otherwise.

Приклади

Приклад #1 Basic usage of ReflectionClass::isInterface()

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

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

Поданий вище приклад виведе:

bool(true)

Прогляньте також

To Top