Skip to content

Commit

Permalink
[PHP 8.4] unserialize() can throw a ValueError and TypeError (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois authored Dec 6, 2024
1 parent da5ebdf commit 792c392
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions reference/var/functions/unserialize.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,15 @@

<refsect1 role="errors">
&reftitle.errors;
<para>
<simpara>
Objects may throw <classname>Throwable</classname>s in their unserialization handlers.
</para>
</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.
</simpara>
</refsect1>

<refsect1 role="changelog">
Expand All @@ -152,6 +158,14 @@
<informaltable>
<tgroup cols="2">
<thead>
<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.
</entry>
</row>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
Expand Down

0 comments on commit 792c392

Please sign in to comment.