Skip to content

Fix property set hook throw must abort assignment (#9670) - #9709

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-9670-property-hook-set-exception
Jun 18, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-9670-property-hook-set-exception

Conversation

@PurHur

@PurHur PurHur commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Summary

php-src reference: Zend/zend_property_hooks.c, Zend/zend_execute.c

Verification

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_property_hook_set_exception.php'
# caught: set hook

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php test/repro/maintainer_gap_readonly_hook_write_exception.php'
# caught: Error

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php vendor/bin/phpunit --filter "property_hook_set_throw|property_hook_readonly_write_throw" test/compliance/VMTest.php'
# OK (2 tests, 2 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php vendor/bin/phpunit --filter property_hook_unset_throw test/compliance/VMTest.php'
# OK (1 test, 1 assertion) — #9666 sibling unchanged

Closes #9670

Made with Cursor

Route set-hook throws and catchable hook-body errors through the same
external-catch bubble used by get/unset hooks so try blocks do not resume
after catch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 4d1fcf4 into master Jun 18, 2026
@PurHur
PurHur deleted the agent/issue-9670-property-hook-set-exception branch June 18, 2026 21:37
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.

Language: property hook set — exception from hook must abort assignment, try block must not resume (Zend/zend_property_hooks.c)

1 participant