Computer >> Computer tutorials >  >> Programming >> PHP

get_declared_interfaces() function in PHP


The get_declared_interfaces() function returns an array of all declared interfaces.

Syntax

get_declared_interfaces(void)

Parameters

  • void  − No parameter is needed

Return

The get_declared_interfaces() function returns an array of all declared interfaces.

Example

The following is an example −

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

Output

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