Skip to content

Fix weird unpack behaviour in DOM#18004

Closed
ndossche wants to merge 1 commit into
php:PHP-8.3from
ndossche:foreach-unpack-dom
Closed

Fix weird unpack behaviour in DOM#18004
ndossche wants to merge 1 commit into
php:PHP-8.3from
ndossche:foreach-unpack-dom

Conversation

@ndossche
Copy link
Copy Markdown
Member

@ndossche ndossche commented Mar 8, 2025

Engine pitfall: the iter index is only updated by foreach opcodes, so the existing code that used it as an index for the nodes w.r.t. the start did not work properly. Fix it by using our own counter.

Engine pitfall: the iter index is only updated by foreach opcodes, so
the existing code that used it as an index for the nodes w.r.t. the
start did not work properly. Fix it by using our own counter.
Copy link
Copy Markdown
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

MSTM

@ndossche
Copy link
Copy Markdown
Member Author

ndossche commented Mar 8, 2025

It's surprising this bug was not found earlier considering it has been here since unpacking became a thing.

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.

2 participants