ReflectionClass::getInterfaceNames

(PHP 5 >= 5.2.0, PHP 7, PHP 8)

ReflectionClass::getInterfaceNamesGets the interface names

Опис

public ReflectionClass::getInterfaceNames(): array

Get the interface names.

Параметри

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

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

A numerical array with interface names as the values.

Приклади

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

<?php
interface Foo { }

interface
Bar { }

class
Baz implements Foo, Bar { }

$rc1 = new ReflectionClass("Baz");

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

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

Array
(
    [0] => Foo
    [1] => Bar
)

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