Skip to content

Compiler: fix var_export after void setIteratorClass() inline arg (#16794) - #16803

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-16794-arrayobject-getiterator-inline
Jul 6, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-16794-arrayobject-getiterator-inline

Conversation

@PurHur

@PurHur PurHur commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference

  • ext/spl/spl_array.c — spl_array_getIteratorClass / spl_array_setIteratorClass

PHP implementation

  • lib/Compiler.php — sibling inline call-arg resolution (no C runtime changes)

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_arrayobject_getiterator_after_set.php'
# 'ArrayIterator'

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/ArrayObjectGetIteratorAfterSetTest.php'
# OK (1 test)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/VMTest.php --filter arrayobject_getiterator_after_set'
# OK (1 test)

Closes #16794

Made with Cursor

Wire hoisted MethodCall producers via operand slots in sibling inline
call-arg resolution so var_export($ao->getIteratorClass(), true) after
setIteratorClass() no longer steals the ctor NEW EXEC_RETURN slot.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 8900568 into master Jul 6, 2026
@PurHur
PurHur deleted the agent/issue-16794-arrayobject-getiterator-inline branch July 6, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: ArrayObject::getIteratorClass() — var_export after setIteratorClass() returns __set_state (re-#10778, ext/spl/spl_array.c)

1 participant