-
-
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
JSON recursion when first object in root list is empty #61
Comments
I think I've run into the same issue. For some reason the Visitor is replacing the reference to the empty object with a reference to the root node. Or something. I'm working on figuring out exactly what's going on but here is what I'm doing:
And this is a screenshot of the root node right before json_encode is called: |
After some more debugging, I've found that line 64 of Admittedly, I'm in a bit over my head here. Adding a simple I would submit a PR for this, but I wonder if I'm just fixing the side effect and not addressing the real problem. Advice? |
Could you send a PR where you add a test-case in a first commit, and your proposed fix in a second commit? |
You don't even need to do "clone" in this case. Just "$this->setRoot(new \ArrayObject());". I was going to submit that and they I have found your pull request. |
To reproduce:
The error:
The text was updated successfully, but these errors were encountered: