class_implements

(PHP 5, PHP 7, PHP 8)

class_implements Return the interfaces which are implemented by the given class or interface

Beschreibung

class_implements(object|string $object_or_class, bool $autoload = true): array|false

This function returns an array with the names of the interfaces that the given object_or_class and its parents implement.

Parameter-Liste

object_or_class

An object (class instance) or a string (class or interface name).

autoload

Whether to call __autoload by default.

Rückgabewerte

An array on success, or false when the given class doesn't exist.

Beispiele

Beispiel #1 class_implements() example

<?php

interface foo { }
class 
bar implements foo {}

print_r(class_implements(new bar));

// you may also specify the parameter as a string
print_r(class_implements('bar'));

spl_autoload_register();

// use autoloading to load the 'not_loaded' class
print_r(class_implements('not_loaded'true));

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

Array
(
    [foo] => foo
)
Array
(
    [foo] => foo
)
Array
(
    [interface_of_not_loaded] => interface_of_not_loaded
)

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

Diablo 4 Season 13 No PTR? Full Guide to Release Date, Changes

Diablo 4 Season 12 is currently underway, and I believe many players, like myself, are already eagerly anticipating Season 13! However, according ...

Geschrieben von abnerRRR am 16.04.2026 03:55:07
Forum: Off-Topic Diskussionen
EZG.com: Your Go-To Platform for Effortless Success in Monopoly GO Ever After

Shocking! Monopoly GO stickers are incredibly cheap on EZG.com! With the release of Monopoly Go's new album Ever After, I was looking for a relia ...

Geschrieben von abnerRRR am 16.04.2026 03:50:55
Forum: Off-Topic Diskussionen
ARC Raiders Week 24 Trials Explained | Fast Completion Guide

If you're like me and follow every official ARC Raiders update, you'll see they release trailers for the new map. But to actually experience this ...

Geschrieben von abnerRRR am 16.04.2026 03:46:51
Forum: Off-Topic Diskussionen
EZG 2026 April Coupon List: Unlock Exclusive Discounts on Popular Games!

With the vast array of games available today, more and more players want to gain an edge in their favorite games without spending excessive time. ...

Geschrieben von abnerRRR am 16.04.2026 03:40:11
Forum: Off-Topic Diskussionen