From 3a3b3279ef971ea38eb12e743b19f68e2f21584d Mon Sep 17 00:00:00 2001
From: Christoph Michael Becker <cmb@php.net>
Date: Wed, 13 May 2020 19:41:26 +0000
Subject: [PATCH] Fix #79593: Manual page missing for class ReflectionReference

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@349867 c90b9560-bf6c-de11-be94-00142212c4b1
---
 reference/reflection/book.xml                 |  1 +
 reference/reflection/reflectionreference.xml  | 70 +++++++++++++++
 .../reflectionreference/fromarrayelement.xml  | 83 ++++++++++++++++++
 .../reflection/reflectionreference/getid.xml  | 86 +++++++++++++++++++
 reference/reflection/versions.xml             |  4 +
 5 files changed, 244 insertions(+)
 create mode 100644 reference/reflection/reflectionreference.xml
 create mode 100644 reference/reflection/reflectionreference/fromarrayelement.xml
 create mode 100644 reference/reflection/reflectionreference/getid.xml

diff --git a/reference/reflection/book.xml b/reference/reflection/book.xml
index 6ab1bea4c8..751eb8ce17 100644
--- a/reference/reflection/book.xml
+++ b/reference/reflection/book.xml
@@ -41,6 +41,7 @@
  &reference.reflection.reflectionproperty;
  &reference.reflection.reflectiontype;
  &reference.reflection.reflectiongenerator;
+ &reference.reflection.reflectionreference;
  &reference.reflection.reflector;
  &reference.reflection.reflectionexception;
 
diff --git a/reference/reflection/reflectionreference.xml b/reference/reflection/reflectionreference.xml
new file mode 100644
index 0000000000..f66c3794ca
--- /dev/null
+++ b/reference/reflection/reflectionreference.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<phpdoc:classref xml:id="class.reflectionreference" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
+
+ <title>The ReflectionReference class</title>
+ <titleabbrev>ReflectionReference</titleabbrev>
+
+ <partintro>
+
+<!-- {{{ ReflectionReference intro -->
+  <section xml:id="reflectionreference.intro">
+   &reftitle.intro;
+   <para>
+    The <classname>ReflectionReference</classname> class provides information about
+    a reference.
+   </para>
+  </section>
+<!-- }}} -->
+
+  <section xml:id="reflectionreference.synopsis">
+   &reftitle.classsynopsis;
+
+<!-- {{{ Synopsis -->
+   <classsynopsis>
+    <ooclass><classname>ReflectionReference</classname></ooclass>
+
+<!-- {{{ Class synopsis -->
+    <classsynopsisinfo>
+     <ooclass>
+      <modifier>final</modifier> <classname>ReflectionReference</classname>
+     </ooclass>
+    </classsynopsisinfo>
+<!-- }}} -->
+    
+    <classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
+    <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionreference')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])">
+     <xi:fallback />
+    </xi:include>
+   </classsynopsis>
+<!-- }}} -->
+
+  </section>
+
+ </partintro>
+
+ &reference.reflection.entities.reflectionreference;
+
+</phpdoc:classref>
+
+<!-- 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
+-->
diff --git a/reference/reflection/reflectionreference/fromarrayelement.xml b/reference/reflection/reflectionreference/fromarrayelement.xml
new file mode 100644
index 0000000000..da7c18ad5f
--- /dev/null
+++ b/reference/reflection/reflectionreference/fromarrayelement.xml
@@ -0,0 +1,83 @@
+<?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>ReflectionReference</type><methodname>ReflectionReference::fromArrayElement</methodname>
+   <methodparam><type>array</type><parameter>array</parameter></methodparam>
+   <methodparam><type>mixed</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
+-->
diff --git a/reference/reflection/reflectionreference/getid.xml b/reference/reflection/reflectionreference/getid.xml
new file mode 100644
index 0000000000..740574fb74
--- /dev/null
+++ b/reference/reflection/reflectionreference/getid.xml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+
+<refentry xml:id="reflectionreference.getid" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <refnamediv>
+  <refname>ReflectionReference::getId</refname>
+  <refpurpose>Get unique ID of a reference</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <modifier>public</modifier> <type>mixed</type><methodname>ReflectionReference::getId</methodname>
+   <void />
+  </methodsynopsis>
+  <para>
+   Returns an ID which is unique for the reference for the lifetime of that reference.
+   This ID can be used to compare references for equality, or to maintain a map of
+   known references.
+  </para>
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  &no.function.parameters;
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   Returns an &integer; or &string; of unspecified format.
+  </para>
+ </refsect1>
+
+ <refsect1 role="examples">
+  &reftitle.examples;
+  <example xml:id="reflectionreference.getid.example.basic">
+   <title>Basic <methodname>ReflectionReference::getId</methodname> usage</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+$val1 = 'foo';
+$val2 = 'bar';
+$arr = [&$val1, &$val2, &$val1];
+
+$rr1 = ReflectionReference::fromArrayElement($arr, 0);
+$rr2 = ReflectionReference::fromArrayElement($arr, 1);
+$rr3 = ReflectionReference::fromArrayElement($arr, 2);
+
+var_dump($rr1->getId() === $rr2->getId());
+var_dump($rr1->getId() === $rr3->getId());
+?>
+]]>
+   </programlisting>
+   &example.outputs;
+   <screen>
+<![CDATA[
+bool(false)
+bool(true)
+]]>
+   </screen>
+  </example>
+ </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
+-->
diff --git a/reference/reflection/versions.xml b/reference/reflection/versions.xml
index 058f6fa86b..a0384021f1 100644
--- a/reference/reflection/versions.xml
+++ b/reference/reflection/versions.xml
@@ -331,6 +331,10 @@
  <function name="reflectiongenerator::getexecutingline" from="PHP 7"/>
  <function name="reflectiongenerator::getexecutingfile" from="PHP 7"/>
  <function name="reflectiongenerator::getexecutinggenerator" from="PHP 7"/>
+
+ <function name="reflectionreference" from="PHP 7 &gt;= 7.4.0" />
+ <function name="reflectionreference::fromarrayelement" from="PHP 7 &gt;= 7.4.0" />
+ <function name="reflectionreference::getid" from="PHP 7 &gt;= 7.4.0" />
 </versions>
 <!-- Keep this comment at the end of the file
 Local variables: