get_declared_interfaces()
get_declared_interfaces() — Returns an array of all declared interfaces.
Built-in function of PHP 8.5. The manual lists it as available in PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
get_declared_interfaces(): array
Parameters
This function takes no parameters.
Return value
Returns an array of the names of the declared interfaces in the current script.
Example
A runnable snippet:
print_r(get_declared_interfaces());
Output:
Array ( [0] => Traversable [1] => IteratorAggregate [2] => Iterator [3] => ArrayAccess [4] => reflector [5] => RecursiveIterator [6] => SeekableIterator )
See also
interface_exists(), get_declared_classes(), class_implements()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page get_declared_interfaces() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.