Skip to content

Commit 7688b7b

Browse files
realFlowControlFlorian EngelhardtGirgias
authored andcommitted
Amend documentation for random_int/random_bytes changes in PHP 8.2 (php#1813)
Co-authored-by: Florian Engelhardt <florian.engelhardt@r-nw.de> Co-authored-by: George Peter Banyard <girgias@php.net>
1 parent 43ec890 commit 7688b7b

File tree

3 files changed

+51
-3
lines changed

3 files changed

+51
-3
lines changed

language-snippets.ent

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,8 +3589,8 @@ local: {
35893589
</listitem>
35903590
<listitem>
35913591
<simpara>
3592-
If none of the aforementioned sources are available, then an
3593-
<classname>Exception</classname> will be thrown.
3592+
If none of the aforementioned sources are available, then a
3593+
<classname>\Random\RandomException</classname> will be thrown.
35943594
</simpara>
35953595
</listitem>
35963596
</itemizedlist>
@@ -3599,7 +3599,7 @@ local: {
35993599
<listitem xmlns="http://docbook.org/ns/docbook">
36003600
<simpara>
36013601
If an appropriate source of randomness cannot be found,
3602-
an <classname>Exception</classname> will be thrown.
3602+
a <classname>\Random\RandomException</classname> will be thrown.
36033603
</simpara>
36043604
</listitem>
36053605
<listitem xmlns="http://docbook.org/ns/docbook">

reference/csprng/functions/random-bytes.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@
5656
</itemizedlist>
5757
</refsect1><!-- }}} -->
5858

59+
<refsect1 role="changelog">
60+
&reftitle.changelog;
61+
<informaltable>
62+
<tgroup cols="2">
63+
<thead>
64+
<row>
65+
<entry>&Version;</entry>
66+
<entry>&Description;</entry>
67+
</row>
68+
</thead>
69+
<tbody>
70+
<row>
71+
<entry>8.2.0</entry>
72+
<entry>
73+
In case of a <acronym>CSPRNG</acronym> failure, this function will now throw a
74+
<classname>\Random\RandomException</classname>. Previously a plain
75+
<classname>\Exception</classname> was thrown.
76+
</entry>
77+
</row>
78+
</tbody>
79+
</tgroup>
80+
</informaltable>
81+
</refsect1>
82+
5983
<refsect1 role="examples"><!-- {{{ -->
6084
&reftitle.examples;
6185
<example xml:id="random-bytes.example.basic"><!-- {{{ -->

reference/csprng/functions/random-int.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,30 @@
6868
</itemizedlist>
6969
</refsect1><!-- }}} -->
7070

71+
<refsect1 role="changelog">
72+
&reftitle.changelog;
73+
<informaltable>
74+
<tgroup cols="2">
75+
<thead>
76+
<row>
77+
<entry>&Version;</entry>
78+
<entry>&Description;</entry>
79+
</row>
80+
</thead>
81+
<tbody>
82+
<row>
83+
<entry>8.2.0</entry>
84+
<entry>
85+
In case of a <acronym>CSPRNG</acronym> failure, this function will now throw a
86+
<classname>\Random\RandomException</classname>. Previously a plain
87+
<classname>\Exception</classname> was thrown.
88+
</entry>
89+
</row>
90+
</tbody>
91+
</tgroup>
92+
</informaltable>
93+
</refsect1>
94+
7195
<refsect1 role="examples"><!-- {{{ -->
7296
&reftitle.examples;
7397
<example xml:id="random-int.example.basic"><!-- {{{ -->

0 commit comments

Comments
 (0)