[doc-en] master: Document boolean support for allowed_classes in unserialize (#4768)
| From: | ImperialCrise via GitHub | Date: | Wed, 19 Aug 2026 05:50:19 +0000 |
| Subject: | [doc-en] master: Document boolean support for allowed_classes in unserialize (#4768) | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-23579@lists.php.net to get a copy of this message | ||
Author: ImperialCrise (ImperialCrise)
Committer: GitHub (web-flow)
Pusher: lacatoire
Date: 2026-08-19T07:50:17+02:00
Commit: https://github.com/php/doc-en/commit/b2acdf5697fa3c189f24c3b0147bef57cb8a6c32
Raw diff: https://github.com/php/doc-en/commit/b2acdf5697fa3c189f24c3b0147bef57cb8a6c32.diff
Document boolean support for allowed_classes in unserialize (#4768)
* 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.
* Nits & boolean -> bool
Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
---------
Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
Changed paths:
M appendices/migration84/incompatible.xml
M reference/var/functions/unserialize.xml
Diff:
diff --git a/appendices/migration84/incompatible.xml b/appendices/migration84/incompatible.xml
index 44ccfe2b4334..947b9dd167f5 100644
--- a/appendices/migration84/incompatible.xml
+++ b/appendices/migration84/incompatible.xml
@@ -409,9 +409,9 @@
<simpara>
The <literal>"allowed_classes"</literal> option for
<function>unserialize</function> now throws
- <exceptionname>TypeError</exceptionname>s and
- <exceptionname>ValueError</exceptionname>s if it is not an
- <type>array</type> of class names.
+ <exceptionname>TypeError</exceptionname> and
+ <exceptionname>ValueError</exceptionname> if it is neither an
+ <type>array</type> of class names nor a <type>bool</type>.
</simpara>
</sect3>
diff --git a/reference/var/functions/unserialize.xml b/reference/var/functions/unserialize.xml
index d43c561a2454..9d3fdef04cf8 100644
--- a/reference/var/functions/unserialize.xml
+++ b/reference/var/functions/unserialize.xml
@@ -149,9 +149,9 @@
</simpara>
<simpara>
As of PHP 8.4.0, if the <literal>allowed_classes</literal> element of
- <parameter>options</parameter> is not an <type>array</type> of class
names,
- <function>unserialize</function> throws
<exceptionname>TypeError</exceptionname>s
- and <exceptionname>ValueError</exceptionname>s.
+ <parameter>options</parameter> is neither an <type>array</type> of class
names
+ nor a <type>bool</type>, <function>unserialize</function> throws
+ <exceptionname>TypeError</exceptionname> and
<exceptionname>ValueError</exceptionname>.
</simpara>
</refsect1>
@@ -170,9 +170,10 @@
<row>
<entry>8.4.0</entry>
<entry>
- Now throws <exceptionname>TypeError</exceptionname>s and
- <exceptionname>ValueError</exceptionname>s if the
<literal>allowed_classes</literal>
- element of <parameter>options</parameter> is not an
<type>array</type> of class names.
+ Now throws <exceptionname>TypeError</exceptionname> and
+ <exceptionname>ValueError</exceptionname> if the
<literal>allowed_classes</literal>
+ element of <parameter>options</parameter> is neither an
<type>array</type> of class names
+ nor a <type>bool</type>.
</entry>
</row>
<row>