Skip to content

Commit f7713b2

Browse files
committed
Document boolean support for allowed_classes in unserialize
- In appendices/migration84/incompatible.xml, update the description of the allowed_classes option to indicate it may be an array of class names or at boolean. - In reference/var/functions/unserialize.xml, clarify that unserialize() throws TypeError and ValueError if options.allowed_classes is not an array or boolean.
1 parent c81a48e commit f7713b2

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

appendices/migration84/incompatible.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,9 +409,9 @@
409409
<simpara>
410410
The <literal>"allowed_classes"</literal> option for
411411
<function>unserialize</function> now throws
412-
<exceptionname>TypeError</exceptionname>s and
413-
<exceptionname>ValueError</exceptionname>s if it is not an
414-
<type>array</type> of class names.
412+
<exceptionname>TypeError</exceptionname> and
413+
<exceptionname>ValueError</exceptionname> if it is neither an
414+
<type>array</type> of class names nor a <type>boolean</type>.
415415
</simpara>
416416
</sect3>
417417

reference/var/functions/unserialize.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,9 @@
146146
</simpara>
147147
<simpara>
148148
As of PHP 8.4.0, if the <literal>allowed_classes</literal> element of
149-
<parameter>options</parameter> is not an <type>array</type> of class names,
150-
<function>unserialize</function> throws <exceptionname>TypeError</exceptionname>s
151-
and <exceptionname>ValueError</exceptionname>s.
149+
<parameter>options</parameter> is neither a <type>array</type> of class names
150+
nor a <type>boolean</type>, <function>unserialize</function> throws
151+
<exceptionname>TypeError</exceptionname> and <exceptionname>ValueError</exceptionname>.
152152
</simpara>
153153
</refsect1>
154154

@@ -167,9 +167,10 @@
167167
<row>
168168
<entry>8.4.0</entry>
169169
<entry>
170-
Now throws <exceptionname>TypeError</exceptionname>s and
171-
<exceptionname>ValueError</exceptionname>s if the <literal>allowed_classes</literal>
172-
element of <parameter>options</parameter> is not an <type>array</type> of class names.
170+
Now throws <exceptionname>TypeError</exceptionname> and
171+
<exceptionname>ValueError</exceptionname> if the <literal>allowed_classes</literal>
172+
element of <parameter>options</parameter> is neither a <type>array</type> of class names
173+
nor a <type>boolean</type>.
173174
</entry>
174175
</row>
175176
<row>

0 commit comments

Comments
 (0)