-
Notifications
You must be signed in to change notification settings - Fork 95
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
$set->toArray is required for Iterator #82
Comments
The problem is presumably that https://github.com/php-ds/extension/blob/master/src/php/iterators/php_htable_iterator.c#L160 does not retain a reference to the object, so in this case the object will be destroyed while the iterator is still in use. |
by the way, the same is true for Map |
@nikic coming back to this, what would be the best way to solve this? I get that we need to hold on to a reference of the object so that it doesn't get collected, so should we add that reference when we create the iterator and release it when we destruct the iterator? |
Can confirm that the fix in #84 produces:
|
This has now been fixed and released as v1.1.9 |
with the extension v1.1.8 (polypill is fine) I seeing this strange behaviour using php 7.1.3
expected output
actual output
The text was updated successfully, but these errors were encountered: