Skip to content

Conversation

ifwrong
Copy link

@ifwrong ifwrong commented Jul 3, 2018

Get the value when enumerator is jsonSerialized

Get the value when enumerator is jsonSerialized
@marc-mabe
Copy link
Owner

Hi @hellow7758521,

I don't think that this is a very good idea because of the following reasons:

  • JSON serialializing has nothing to do with an enum implementation
  • It's super simple to implement in your own defined enumerations
  • it might be naturally for you to serialize based on the values but other probably would use the ordinal number or both
  • it's not possible to know how to serialize array objects -> should that be in JS-Object-Notation or JS-Array (php value [] to JSON value [] or {})

@marc-mabe marc-mabe closed this Aug 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants