Skip to content
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

Inconsistent serialization behavior for PHP arrays #84

Merged
merged 6 commits into from
Sep 13, 2021

Conversation

lstrojny
Copy link
Owner

@lstrojny lstrojny commented Aug 17, 2021

Addresses #82

Changes

  • Non-contiguous PHP arrays or PHP arrays that don’t start with 0 are now always converted to XML/RPC structs
  • Objects are consistently converted to XML/RPC structs
    • (object) [0 => 'val'] will result in an XML/RPC struct with a member of name "0".
    • (object) [] will result in an empty XML/RPC struct, while [] will result in an empty XML/RPC array

Implications

Especially the change in handling for non-contiguous PHP arrays is kinda tricky since it could break code that’s working right now. I am still considering if this new behavior should be opt-in to keep backwards compatibility.

@lstrojny lstrojny changed the title Bugfix for inconsistent array serialization Inconsistent serialization behavior for PHP arrays Aug 17, 2021
@lstrojny lstrojny merged commit f9d19c1 into master Sep 13, 2021
@lstrojny lstrojny deleted the bugfix/inconsistent-array-serialization branch September 13, 2021 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant