Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<ReflectionReference::__constructReflectionReference::getId>
^ReflectionReferenceLast updated: Mon, 26 Oct 2026

ReflectionReference::fromArrayElement

(PHP 7 >= 7.4.0, PHP 8)

ReflectionReference::fromArrayElement — Create a ReflectionReference from an array element

Description

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

Creates a ReflectionReference from an array element.

Parameters

array

The array which contains the potential reference.

key

The key; either an int or a string.

Return Values

Returns a ReflectionReference instance if $array[$key] is a reference, or null otherwise.

Errors/Exceptions

If array is not an array, or key is not an int or string, a TypeError is thrown. If $array[$key] does not exist, a ReflectionException is thrown.


<ReflectionReference::__constructReflectionReference::getId>
^ReflectionReferenceLast updated: Mon, 26 Oct 2026