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
PHP 8.4 asymmetric visibility (public private(set)) on constructor-promoted properties must compile and enforce the same rules as ordinary properties. This compiler lowers asymmetric visibility via AsymmetricVisibilityRewriter / propertySetVisibility for explicit properties, but promoted parameters with private(set) may lose set-visibility metadata or allow illegal writes from the constructor body/global scope.
php-src reference
Zend/zend_compile.c — promoted property visibility + asymmetric set visibility
Category
languageProblem
PHP 8.4 asymmetric visibility (
public private(set)) on constructor-promoted properties must compile and enforce the same rules as ordinary properties. This compiler lowers asymmetric visibility viaAsymmetricVisibilityRewriter/propertySetVisibilityfor explicit properties, but promoted parameters withprivate(set)may lose set-visibility metadata or allow illegal writes from the constructor body/global scope.php-src reference
Zend/zend_compile.c— promoted property visibility + asymmetric set visibilityZend/zend_object_handlers.c— asymmetric write checksRepro (today)
alice+ cannot modifyprivate(set)messageScope (this repo)
lib/Compiler.phppromoted param → property (asymmetricSetVisibilityFromCfgOp)lib/SourcePreprocessor/AsymmetricVisibilityRewriter.phplib/VM.php,lib/JIT/AsymmetricVisibilityGuard.phptest/compliance/cases/language/asymmetric_visibility_promoted.phptDone when
Erroron external write)./script/ci-fast.sh --filter asymmetric_visibility_promotedgreenLinks