php-doc-en/reference/reflection/reflectionreference/fromarrayelement.xml
Máté Kocsis 98df2cf9a9 Generate reflection methodsynopses based on stubs
We also document the new `$filter` parameter for the `ReflectionClass`
methods `::getConstants()` and `::getReflectionConstants()` and the
respective constants.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-298.
2020-12-31 17:03:54 +01:00

81 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="reflectionreference.fromarrayelement" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionReference::fromArrayElement</refname>
<refpurpose>Create a ReflectionReference from an array element</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>ReflectionReference</type><type>null</type></type><methodname>ReflectionReference::fromArrayElement</methodname>
<methodparam><type>array</type><parameter>array</parameter></methodparam>
<methodparam><type class="union"><type>int</type><type>string</type></type><parameter>key</parameter></methodparam>
</methodsynopsis>
<para>
Creates a <classname>ReflectionReference</classname> from an array element.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>array</parameter></term>
<listitem>
<para>
The &array; which contains the potential reference.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>key</parameter></term>
<listitem>
<para>
The key; either an &integer; or a &string;.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <classname>ReflectionReference </classname> instance if
<literal>$array[$key]</literal> is a reference, or &null; otherwise.
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If <parameter>array</parameter> is not an &array;, or <parameter>key</parameter>
is not an &integer; or &string;, a <classname>TypeError</classname> is thrown.
If <literal>$array[$key]</literal> does not exist,
a <classname>ReflectionException</classname> is thrown.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->