English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP tutorial

Advanced PHP tutorial

PHP & MySQL

PHP reference manual

PHP get_declared_interfaces() function usage and example

PHP Class/Object function reference manual

The get_declared_interfaces() function returns an array containing all declared interfaces

Syntax

get_declared_interfaces ( void );

Definition and usage

This function retrieves declared interfaces.

Parameter

Serial numberParameters and description
1

void

void indicates that no parameters are required.

Return value

 This function returns an array containing the names of all declared interfaces in the current script.

Online examples

The following is the usage of this function-

<?php
   print_r(get_declared_interfaces());
?>
Test and see‹/›

It will produce the following results-

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
)

   PHP Class/Object function reference manual