You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: constructor-promoted public private(set) accepted — must compile-fatal (re-#6981, Zend/zend_compile.c) #9691
language · php-src-strict · regression of #6981 / #6742
Problem
Constructor-promoted properties with bothpublic and asymmetric private(set) must be a compile-time fatal in PHP 8.4 (Multiple access type modifiers are not allowed). The VM accepts the syntax and runs the constructor, returning the promoted value.
Fix:AsymmetricVisibilityRewriter::rejectExplicitReadBeforeAsymmetricSetModifier() rejects explicit read visibility before asymmetric (set) modifiers (including single-line promoted constructor params) with php-src's Multiple access type modifiers are not allowed.
Verification:
php bin/vm.php test/repro/maintainer_gap_promoted_private_set.php → compile fatal (no output 1)
php vendor/bin/phpunit test/unit/AsymmetricVisibilityRewriterTest.php test/unit/AsymmetricVisibilityCompileCheckTest.php → OK (28 tests)
Valid private(set) promoted ctor compliance case unchanged
Activity
PurHur commentedon Jun 18, 2026
claim: cursor-agent-lane-b — starting this run
Reject public private(set) on promoted constructor params (#9691) (#9699
PurHur commentedon Jun 18, 2026
Merged via #9699
Fix:
AsymmetricVisibilityRewriter::rejectExplicitReadBeforeAsymmetricSetModifier()rejects explicit read visibility before asymmetric(set)modifiers (including single-line promoted constructor params) with php-src's Multiple access type modifiers are not allowed.Verification:
php bin/vm.php test/repro/maintainer_gap_promoted_private_set.php→ compile fatal (no output1)php vendor/bin/phpunit test/unit/AsymmetricVisibilityRewriterTest.php test/unit/AsymmetricVisibilityCompileCheckTest.php→ OK (28 tests)private(set)promoted ctor compliance case unchanged