Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
PHP
/
Enums
What is the default JSON behavior of a pure enum?
from Enums
PHP 8.3.33
intermediate
1 min
What is the default JSON behavior of a pure enum?
It has no default JSON representation; JSON_THROW_ON_ERROR produces JsonException.
It encodes to its case name as a JSON string.
It encodes to an empty object.
It encodes to the case index from cases().
Check
Ask AI about this kata
Report an error
previous kata
What does this program print?
Predict the output
next kata
Review generated status parser
Review AI code
A new version is available
Reload