Skip to content

zend_objects: Remove unnecessary refcounting when calling __clone() #19145

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 16, 2025

Conversation

TimWolla
Copy link
Member

@TimWolla TimWolla commented Jul 16, 2025

Found as part of the clone-with review in #18747.


Specifically: https://github.com/php/php-src/pull/18747/files#r2209484855

@TimWolla TimWolla requested a review from nielsdos July 16, 2025 07:13
@TimWolla TimWolla requested a review from dstogov as a code owner July 16, 2025 07:13
@TimWolla TimWolla mentioned this pull request Jul 16, 2025
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

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

Assuming the caller of zend_objects_clone_members() holds a strong reference to new_object that cannot be invalidated by __clone is reasonable.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Tried to cheat it, for example with creating self-references, but it seems fine.

@TimWolla TimWolla merged commit 2e0c011 into php:master Jul 16, 2025
9 checks passed
@TimWolla TimWolla deleted the clone-refcount branch July 16, 2025 16:53
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