PHP Function Reference

PHP get_declared_interfaces() Function



The PHP get_declared_interfaces() function returns an array with the name of all declared interfaces.

Syntax

get_declared_interfaces()

Parameters

No parameter is required.

Return Value

Returns an array of the names of the declared interfaces in the current script.

Example: get_declared_interfaces() example

The example below shows the usage of get_declared_interfaces() function.

<?php
print_r(get_declared_interfaces());
?>

The output of the above code will be similar to:

Array
(
    [0] => Traversable
    [1] => IteratorAggregate
    [2] => Iterator
    [3] => Serializable
    [4] => ArrayAccess
    [5] => Countable
    [6] => Stringable
    [7] => Throwable
    [8] => DateTimeInterface
    [9] => JsonSerializable
    [10] => Reflector
    [11] => RecursiveIterator
    [12] => OuterIterator
    [13] => SeekableIterator
    [14] => SplObserver
    [15] => SplSubject
    [16] => SessionHandlerInterface
    [17] => SessionIdInterface
    [18] => SessionUpdateTimestampHandlerInterface
    [19] => DOMParentNode
    [20] => DOMChildNode
)

❮ PHP Classes/Objects Reference