-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
Fix stdClass inconsistencies when serializing to JSON #730
Conversation
@@ -263,7 +265,85 @@ public function testSerializeWithNonUtf8EncodingWhenDisplayErrorsOn() | |||
|
|||
public function testSerializeArrayWithEmptyObject() | |||
{ | |||
$this->assertEquals('{"0":{}}', $this->serialize(array(new \stdClass()))); | |||
$this->assertEquals('[{}]', $this->serialize(array(new \stdClass()))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this to me sounds a wrong test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@schmittjoh What do you think?
c02fecf
to
ca3bf73
Compare
…tion for the json visitor
…er object is a empty stdclass is obviously wrong
ca3bf73
to
39f8401
Compare
With the class |
I really do not suggest to use But to answer to your question, using directly |
Fixes #61
Closes #59
Closes #242