class_implements

(PHP 5)

class_implements --  Return the interfaces which are implemented by the given class

Leírás

array class_implements ( mixed class [, bool autoload] )

This function returns an array with the names of the interfaces that the given class implements.

Paraméterek

class

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

Visszatérési értékek

Returns an array or FALSE on error.

Változások naplója

VáltozatLeírás
5.1.0 Added the option to pass the parameter as a string

Példák

Példa 1. class_implements() example

<?php

interface foo
{ }
class
bar implements foo {}

print_r(class_implements(new bar));

?>

A fenti példa a következő kimenetet adja:

Array
(
    [foo] => foo
)

Lásd még

class_parents()