array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'reflectionclass.getinterfaces.php', 1 => 'ReflectionClass::getInterfaces', 2 => 'Gets the interfaces', ), 'up' => array ( 0 => 'class.reflectionclass.php', 1 => 'ReflectionClass', ), 'prev' => array ( 0 => 'reflectionclass.getinterfacenames.php', 1 => 'ReflectionClass::getInterfaceNames', ), 'next' => array ( 0 => 'reflectionclass.getlazyinitializer.php', 1 => 'ReflectionClass::getLazyInitializer', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/reflection/reflectionclass/getinterfaces.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

ReflectionClass::getInterfaces

(PHP 5, PHP 7, PHP 8)

ReflectionClass::getInterfacesGets the interfaces

Опис

public ReflectionClass::getInterfaces(): array

Gets the interfaces.

Параметри

У цієї функції немає параметрів.

Значення, що повертаються

An associative array of interfaces, with keys as interface names and the array values as ReflectionClass objects.

Приклади

Приклад #1 ReflectionClass::getInterfaces() example

<?php
interface Foo { }

interface
Bar { }

class
Baz implements Foo, Bar { }

$rc1 = new ReflectionClass("Baz");

print_r($rc1->getInterfaces());
?>

Поданий вище приклад виведе щось схоже на:

Array
(
    [Foo] => ReflectionClass Object
        (
            [name] => Foo
        )

    [Bar] => ReflectionClass Object
        (
            [name] => Bar
        )

)

Прогляньте також