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
Language: final plain properties isFinal=0 + child override accepted under PROFILE=8.4 (re-#27315, Zend/zend_inheritance.c) #27818
Language · php-src-strict · PHP 8.4 final properties
Problem
Under PHP_COMPILER_PROFILE=8.4, plain final public properties still report ReflectionProperty::isFinal() === false, and a child class may redeclare the same property. Zend/php-src 8.4+ keeps post-construct writes allowed (inheritance-only final) but isFinal() is true and child redeclaration is a compile fatal. Previously closed as fixed in #27315 / PR #27336 — regressed on master (verified 2026-08-05).
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php test/repro/maintainer_gap_final_plain_property_84.php'# expect: wrote / isFinal=1# actual: wrote / isFinal=0
./script/docker-exec.sh -- bash -lc 'PHP_COMPILER_PROFILE=8.4 php bin/vm.php -r "class A { final public string \$x = \"a\"; }class B extends A { public string \$x = \"c\"; }echo \"bad\n\";"'# expect: Fatal error (cannot override final property)# actual: prints bad
Done when
PROFILE=8.4 VM/JIT/AOT: isFinal=1 on committed repro; post-construct write still succeeds (Zend inheritance-only semantics)
Child redeclaration of a final plain property is a compile fatal matching Zend
Compliance/unit guard under test/compliance/ or test/unit/ for isFinal + override
Issue-body plain repro PROFILE=8.4 VM/AOT: wrote / isFinal=1 (already green on tip; locked)
Trait-imported final (AOT hole closed): VM/AOT isFinal=1; child override AOT build exit 255 Cannot override final property A::$x
vendor/bin/phpunit --filter FinalPropertyOverrideCheckTest OK (21)
vendor/bin/phpunit --filter final_plain_property_trait_isfinal_84 OK
Root cause: inheritTraitInstanceProperties copied readonly but not ZEND_ACC_FINAL into Object_::finalPropertyNames; FinalPropertyOverrideCheck ignored TraitUse.
Activity
PurHur commentedon Aug 5, 2026
claim: worker-lane-C — starting this run
Pillar snapshot (pre-claim):
bootstrap-inventory.php --check: doc drift (construct flags / ScopeBuiltinJitHelper) — regenerate needed on tiprelease-readiness --json: still running at claim timeRepro target: PROFILE=8.4 final plain property
isFinal+ child override fatal (re-#27315).PurHur commentedon Aug 5, 2026
claim: worker-lane-C — continuing this run (prior claim had no PR/branch; taking implementation)
Pillar snapshot:
Language: AOT trait-imported final props keep isFinal + override fatal (
PurHur commentedon Aug 5, 2026
merged: #27861 (
435f54089c)Verification (Docker
./script/docker-exec.sh):wrote/isFinal=1(already green on tip; locked)isFinal=1; child override AOT build exit 255Cannot override final property A::$xvendor/bin/phpunit --filter FinalPropertyOverrideCheckTestOK (21)vendor/bin/phpunit --filter final_plain_property_trait_isfinal_84OKRoot cause:
inheritTraitInstancePropertiescopied readonly but notZEND_ACC_FINALintoObject_::finalPropertyNames;FinalPropertyOverrideCheckignoredTraitUse.