[doc-en] master: unserialization: Documented allowed-classes option with enums (#5585)

From: Date: Mon, 08 Jun 2026 19:17:15 +0000
Subject: [doc-en] master: unserialization: Documented allowed-classes option with enums (#5585)
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-23359@lists.php.net to get a copy of this message
Author: Volker Dusch (edorian) Committer: GitHub (web-flow) Pusher: jordikroon Date: 2026-06-08T21:17:12+02:00 Commit: https://github.com/php/doc-en/commit/8af3521cb43f54c652baaf8dbbcb786b79a5d04e Raw diff: https://github.com/php/doc-en/commit/8af3521cb43f54c652baaf8dbbcb786b79a5d04e.diff unserialization: Documented allowed-classes option with enums (#5585) * unserialization: Documented allowed-classes option with enums Changed paths: M language/enumerations.xml M reference/var/functions/unserialize.xml Diff: diff --git a/language/enumerations.xml b/language/enumerations.xml index 840fe9ef2dc8..8a346156ccce 100644 --- a/language/enumerations.xml +++ b/language/enumerations.xml @@ -835,6 +835,12 @@ print serialize(Suit::Hearts); On deserialization, if an enum and case cannot be found to match a serialized value a warning will be issued and &false; returned.</para> + <simpara> + The <literal>allowed_classes</literal> option of + <function>unserialize</function> does not affect + <link linkend="language.enumerations">Enumerations</link>. + </simpara> + <para> If a Pure Enum is serialized to JSON, an error will be thrown. If a Backed Enum is serialized to JSON, it will be represented by its scalar value only, in the diff --git a/reference/var/functions/unserialize.xml b/reference/var/functions/unserialize.xml index 0b3128a90124..d43c561a2454 100644 --- a/reference/var/functions/unserialize.xml +++ b/reference/var/functions/unserialize.xml @@ -103,6 +103,9 @@ Omitting this option is the same as defining it as &true;: PHP will attempt to instantiate objects of any class. </simpara> + <simpara> + This option does not affect <link linkend="language.enumerations">Enumerations</link>. + </simpara> </entry> </row> <row>

« previous php.doc.cvs (#23359) next »