-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
json_encode
on empty Map returns array
#157
Comments
This is unfortunately how JsonSerializable works, where The method in the extension is implemented to delegate it to an array:
Actually, we can cast that to an I'll try the object cast in the meantime - thanks for brining this up. |
I think this should do it. 078243f |
Thank you very much! |
This has now been fixed and released as part of 1.3.0 |
I was glad to see, that
Map
data structure can be json-encoded.But if you run
json_encode()
on empty map, it gets gets encoded as an array -[]
.I think this is a bug, since Map should always be encoded as an object -
{}
.Thank you very much in advance!
The text was updated successfully, but these errors were encountered: