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: property hooks + explicit backing — spurious Cannot redeclare when sibling property sits between hook and backing (re-#9673, Zend/zend_compile.c) #16936
Valid PHP 8.4 classes with a hooked property, an unrelated sibling property, and an explicit private backing field for the hook compile on Zend but fail here with Cannot redeclare C::$x.
Repro
Zend 8.4
VM (2026-07-06)
hooked $x + public string $y + private int $x backing
compiles; $c->x works
parseAndCompile failure: Cannot redeclare C::$x
hooked $x + private int $x only (no sibling)
compiles
compiles (A ok)
Discovered via maintainer VM scan (test/repro/maintainer_gap_property_hook_multi_property_redeclare.php). Regression of #9673 — closed 2026-06-18 but repro red again on master with PHP_COMPILER_PROFILE=8.4.
lib/Compiler.php / property-hook decl collector — do not treat explicit backing $x as a duplicate symbol when a sibling property is declared between the hook and backing field
Fix: PropertyHooks preprocessor merges detached same-name backing fields (initializer folded into hooked property decl; backing field removed from class body) so sibling properties between hook and backing no longer trigger spurious Cannot redeclare.
Activity
PurHur commentedon Jul 6, 2026
claim: cursor-agent-lane-b — starting this run
PurHur commentedon Jul 6, 2026
Merged via #16941.
Fix: PropertyHooks preprocessor merges detached same-name backing fields (initializer folded into hooked property decl; backing field removed from class body) so sibling properties between hook and backing no longer trigger spurious
Cannot redeclare.Verification:
Language: merge detached property-hook backing past sibling members (#…