Signatur
interface_exists(string $interface, bool $autoload = true): bool
Beschreibung
Analog zu class_exists(), aber für Interfaces.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $interface Pflicht | string | — | FQN. |
Rückgabewert
Typ
bool
Beispiele
Basis
<?php
if (interface_exists(Psr\Log\LoggerInterface::class)) { /* ... */ }