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。

User Contributed Notes
There are no user contributed notes for this page.
备份地址:http://www.lvesu.com/blog/php/reflectionreference.fromarrayelement.php