array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'reflectionclass.isinterface.php', 1 => 'ReflectionClass::isInterface', 2 => 'Checks if the class is an interface', ), 'up' => array ( 0 => 'class.reflectionclass.php', 1 => 'ReflectionClass', ), 'prev' => array ( 0 => 'reflectionclass.isinstantiable.php', 1 => 'ReflectionClass::isInstantiable', ), 'next' => array ( 0 => 'reflectionclass.isinternal.php', 1 => 'ReflectionClass::isInternal', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/reflection/reflectionclass/isinterface.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isInterfaceChecks if the class is an interface

Опис

public 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)

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