Skip to content

Language: asymmetric write Error omits get-visibility (#21526) - #21529

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-21526-asymmetric-private-set-message
Jul 20, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-21526-asymmetric-private-set-message

Conversation

@PurHur

@PurHur PurHur commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Align asymmetric set-visibility Error text with Zend 8.4.23 / zend_asymmetric_visibility_property_modification_error: use private(set) / protected(set) only (omit get-visibility).
  • Update compliance + unit EXPECT strings that still expected public private(set) or public (private(set)).
  • PHP-in-PHP only (lib/Ast/AsymmetricVisibilityRewriter::writeModifierLabel); no C changes.

Closes #21526

php-src reference

  • Zend/zend_errors.c — zend_asymmetric_visibility_property_modification_error
  • Zend/zend_object_handlers.c — asymmetric set guards

Verification

# Trust (pre-claim)
php script/bootstrap-inventory.php --check
# OK 6177/6177
./script/release-readiness.sh --json
# user_release_ready: yes (north-star5-fast ok)

# Issue repro
./script/docker-exec.sh -- bash -lc 'export PHP_COMPILER_PROFILE=8.4
php bin/vm.php -r "
class A { public private(set) string \$x = \"a\"; }
\$a = new A();
try { \$a->x = \"b\"; } catch (Throwable \$e) { echo \$e->getMessage(), PHP_EOL; }
"'
# Cannot modify private(set) property A::$x from global scope

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && export PHP_COMPILER_PROFILE=8.4 && vendor/bin/phpunit --filter testWriteModifierLabelMatchesZendSetOnly test/unit/AsymmetricVisibilityRewriterTest.php'
# OK (1 test, 3 assertions)

./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && export PHP_COMPILER_PROFILE=8.4 && vendor/bin/phpunit --filter "asymmetric_visibility_write|asymmetric_visibility_catchable|asymmetric_visibility_protected_set|asymmetric_visibility_set_modifier|asymmetric_visibility_bare_public_private_set|asymmetric_hook_write_error|property_hook_private_set_in_block|property_hook_asymmetric_set|promoted_asymmetric_visibility_fatal|promoted_paren_private_set_reject|asymmetric_visibility_reference|asymmetric_visibility_interface|asymmetric_get_only_hook_write|asymmetric_visibility_jit|asymmetric_visibility_public_private_set_runtime|asymmetric_visibility_public_private_set_write" test/compliance/VMTest.php'
# 19 message/runtime cases green (1 unrelated reference-profile SKIPIF miss under PROFILE=8.4)

Test plan

  • Issue repro matches Zend message exactly
  • Unit label helper + compliance EXPECT updates
  • VM + JIT compliance filters for asymmetric write errors

Made with Cursor

Match zend_asymmetric_visibility_property_modification_error: private(set)/protected(set) only, not "public private(set)".

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f9736d6 into master Jul 20, 2026
@PurHur
PurHur deleted the agent/issue-21526-asymmetric-private-set-message branch July 20, 2026 17:47
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: asymmetric private(set) Error message includes public — Zend omits get-visibility (Zend/zend_object_handlers.c)

1 participant