Skip to content

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Jul 5, 2017

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is done for every class. Is it not possible to extract this into its own function? It would save a lot of boiler plate.

(intern)->properties = (props); \
} \
} while(0);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derickr: Refactored to use a macro. A function wasn't feasible since the type of intern varies with each class.

Copy link
Contributor

@derickr derickr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jmikola jmikola merged commit ad1f3f0 into mongodb:master Jul 11, 2017
jmikola added a commit that referenced this pull request Jul 11, 2017
@jmikola jmikola deleted the phpc-939 branch July 11, 2017 13:23
jmikola added a commit to jmikola/mongo-php-driver that referenced this pull request Jan 9, 2018
This removes a call to zend_hash_clean() on successive calls to a BSON object's get_properties handler, which can lead to an infinite loop when iterating the object's properties with foreach on PHP 7.x.

For historical reference, the original call to zend_hash_clean() was introduced in ad1f3f0 for mongodb#607 (PHPC-939).
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