diff --git a/language/enumerations.xml b/language/enumerations.xml index 997897015312..118ca3286d39 100644 --- a/language/enumerations.xml +++ b/language/enumerations.xml @@ -816,6 +816,11 @@ 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. + + The allowed_classes option of + unserialize does not affect enums. + + 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 966e1bcc9a8b..432738d60538 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. + + This option does not affect enums. +