Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bugfix: arrays returned as objects like {"0":... } #304

Closed
wants to merge 1 commit into from
Closed

Bugfix: arrays returned as objects like {"0":... } #304

wants to merge 1 commit into from

Conversation

Nadrieril
Copy link

Sometimes an array gets returned as {"0":..., "1":...} instead of [..., ...]. Furthermore, this behaviour only appears at the root; when nesting arrays only the root is affected. I have seen multiple users being confronted to this bug. It is pretty annoying.
This is how I understand the code: In this part of the code, you assume that empty($rs) && array() === $this->getRoot() imply that the root is an empty array, that should then be returned as {} instead of []. But you don't actually check that you are at the root. That is the check I add.

Bugfix: the root could be modified when it shouldn't
@dizda
Copy link

dizda commented Nov 18, 2014

👍

@adrienbrault
Copy link
Contributor

You should start by adding a failing test

@dizda
Copy link

dizda commented Dec 12, 2014

I can add a failing test, but tests fails anyway with the actual codebase.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants