|
Serialization
Enumerations are serialized differently from objects. Specifically, they have a new serialization code,
On deserialization, if an enum and case cannot be found to match a serialized
value a warning will be issued and 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 appropriate type. The behavior of both may be overridden by implementing JsonSerializable. For print_r, the output of an enum case is slightly different from objects to minimize confusion.
|