Skip to content

PHPC-1005: Use convert_to_object() to create stdClass from array #642

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

Merged
merged 1 commit into from
Sep 6, 2017

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Sep 2, 2017

https://jira.mongodb.org/browse/PHPC-1005

This will ensure that the array symtable is properly converted to an object proptable in PHP 7.2 (e.g. integer key 0 converts to string key "0").

@bjori
Copy link
Contributor

bjori commented Sep 5, 2017

I don't quite understand this change.
If PHP7.2 no longer creates the properties table, isn't that a bug in PHP 7.2?

I've no memories as to why this was done this way though, it seems weird if there was no point..
maybe tsrmls weirdness or something?
I've no idea.

@bjori
Copy link
Contributor

bjori commented Sep 5, 2017

Ok. Now I get it. This adds support for the new PHP 7.2 casting feature.
The change outside of the version ifdefs is just to keep the code consistent as there is no functional difference in calling one or the other in earlier versions.
lgtm

@jmikola
Copy link
Member Author

jmikola commented Sep 6, 2017

there is no functional difference in calling one or the other in earlier versions

That's correct. In PHP versions before 7.2, we'll get an extra switch statement on the zval type, but I'm not worried about that.

This will ensure that the array symtable is properly converted to an object proptable in PHP 7.2 (e.g. integer key 0 converts to string key "0").
@jmikola jmikola merged commit 95c4678 into mongodb:master Sep 6, 2017
jmikola added a commit that referenced this pull request Sep 6, 2017
@jmikola jmikola deleted the phpc-1005 branch September 6, 2017 18:34
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.

2 participants