You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The methods in Enum class related to serialization have the following sentence in the doc block: Enums are not serializable because instances are implemented as singletons.
When I first heard of enums and started using them with the help of this library and read I this sentence, I thought this describes the nature of enums, i.e. enum as a data type is unserializable by definition. However after some time, when I gained more programming knowledge I know that enums are serializable even though they are singletons but this cannot be implemented in pseudo-enum implementation via PHP classes.
Expected behavior:
Change the doc block to something like "Serialization is not supported as in this pseudo-enum implementation there is no way to unserialize and keep the enum cases as singletons at the same time." (feel free to reword).
The text was updated successfully, but these errors were encountered:
Detailed description:
The methods in Enum class related to serialization have the following sentence in the doc block:
Enums are not serializable because instances are implemented as singletons
.When I first heard of enums and started using them with the help of this library and read I this sentence, I thought this describes the nature of enums, i.e. enum as a data type is unserializable by definition. However after some time, when I gained more programming knowledge I know that enums are serializable even though they are singletons but this cannot be implemented in pseudo-enum implementation via PHP classes.
Expected behavior:
Change the doc block to something like "Serialization is not supported as in this pseudo-enum implementation there is no way to unserialize and keep the enum cases as singletons at the same time." (feel free to reword).
The text was updated successfully, but these errors were encountered: