Skip to content

Fix rc info of iterator_to_array #9080

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
Jul 21, 2022

Conversation

iluuu1994
Copy link
Member

This function can now return a copy of the provided array, resulting in
a value of RC != 1.

This function can now return a copy of the provided array, resulting in
a value of RC != 1.
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Good catch, thank you!

Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

I can confirm that I added a RETURN_COPY there. Is there some reference documentation for the @refcount values so I can learn what they mean?

@iluuu1994
Copy link
Member Author

@TimWolla It's a guarantee that the function will return a value with the given refcount. Adding this attribute gives the optimizer more information about the value, although I don't know exactly in what ways it's used.

@iluuu1994 iluuu1994 merged commit d4a9cc8 into php:master Jul 21, 2022
@cmb69
Copy link
Member

cmb69 commented Jul 21, 2022

I don't think there's any documentation about func_infos. Might be a good idea to put something up at https://www.phpinternalsbook.com/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants