Skip to content

ext/simplexml: Report temporary and iterator values to the GC - #24296

Open
iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/aph-simplexml-get-gc-xuo-84-work
Open

iliaal wants to merge 1 commit into
php:PHP-8.4from
iliaal:fix/aph-simplexml-get-gc-xuo-84-work

Conversation

@iliaal

@iliaal iliaal commented Oct 13, 2026

Copy link
Copy Markdown
Member

sxe_get_gc() reported only the properties table, so a cycle through the value behind a reference to a missing property ($r =& $sxe->missing; $r = $sxe;), through the current iteration element, or through a foreach iterator held by a suspended generator was never collected. It now also reports sxe->tmp and sxe->iter.data, and the iterator reports its data zval.

sxe_get_gc() reported only the properties table, so a cycle closed through
sxe->tmp (the value behind a reference to a missing property) or through
sxe->iter.data (the current iteration element) was never collected, nor was
one through a foreach iterator, whose get_gc slot was NULL. Report all
three. The other php_sxe_object fields hold strings or libxml state, and
declared properties of subclasses are not writable from userland.
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.

1 participant