PHP Conference Fukuoka 2025

ReflectionClass::isInterface

(PHP 5, PHP 7, PHP 8)

ReflectionClass::isInterfaceChecks if the class is an interface

Descrizione

public ReflectionClass::isInterface(): bool

Checks whether the class is an interface.

Elenco dei parametri

Questa funzione non contiene parametri.

Valori restituiti

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

Esempi

Example #1 Basic usage of ReflectionClass::isInterface()

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

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

Il precedente esempio visualizzerà:

bool(true)

Vedere anche:

add a note

User Contributed Notes

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