略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: get_declared_interfaces

2024-04-29

get_declared_interfaces

(PHP 5, PHP 7, PHP 8)

get_declared_interfaces返回一个数组包含所有已声明的接口

说明

get_declared_interfaces(): array

返回一个数组包含所有已声明的接口。

返回值

本函数返回一个数组,其内容是当前脚本中所有已声明的接口的名字。

范例

示例 #1 get_declared_interfaces() 例子

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

以上例程的输出类似于:

Array
(
    [0] => Traversable
    [1] => IteratorAggregate
    [2] => Iterator
    [3] => ArrayAccess
    [4] => reflector
    [5] => RecursiveIterator
    [6] => SeekableIterator
)

参见

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/function.get-declared-interfaces.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3