略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: ReflectionReference::fromArrayElement

2024-04-28

ReflectionReference::fromArrayElement

(PHP 7 >= 7.4.0, PHP 8)

ReflectionReference::fromArrayElement从数组元素创建一个 ReflectionReference

说明

public static ReflectionReference::fromArrayElement(array $array, int|string $key): ?ReflectionReference

从数组元素创建一个 ReflectionReference

参数

array

包含潜在引用的 array

key

一个 int 或者 string 类型的 key。

返回值

如果 $array[$key] 是引用,返回 ReflectionReference 实例,否则返回 null

错误/异常

如果 array 不是一个 array,或者 key 不是 int 或者 string 类型,会抛出 TypeError。 如果 $array[$key] 不存在, 会抛出 ReflectionException

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/reflectionreference.fromarrayelement.php

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