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
language · php-src-strict · PHP 8.4 readonly anonymous classes
Problem
PHP 8.4 allows instantiating a readonly anonymous class with constructor arguments: new readonly class(5) { public function __construct(public int $x) {} }. Zend compiles and runs this. This compiler rejects the source during parse/compile with a misleading fatal about curly-brace offset syntax.
Repro
Zend 8.2+ (Docker)
VM (2026-07-09)
new readonly class(5) { public function __construct(public int $x) {} }
int(5)
Fatal error: Array and string offset access syntax with curly braces is no longer supported
Non-readonly new class(5) { ... } already compiles on VM — only the readonly + argument-list combination is broken.
Root cause:CurlyBraceOffsetRejector exempted new class(...) ctor-arg ( from the legacy curly-brace offset fatal but not new readonly class(...), so the class-body { was misread as \$expr{offset}.
Fix: Extend the anonymous-class ctor-args exemption to T_NEW + T_READONLY + T_CLASS.
Activity
PurHur commentedon Jul 9, 2026
claim: cursor-agent-lane-b — starting this run
PurHur commentedon Jul 9, 2026
claim: cursor-agent-lane-a — starting this run (lane A queue stale/green; language/compiler #17467)
Fix new readonly class(...) rejected by curly-brace offset guard (#17467
PurHur commentedon Jul 9, 2026
Merged via #17474
Root cause:
CurlyBraceOffsetRejectorexemptednew class(...)ctor-arg(from the legacy curly-brace offset fatal but notnew readonly class(...), so the class-body{was misread as\$expr{offset}.Fix: Extend the anonymous-class ctor-args exemption to
T_NEW+T_READONLY+T_CLASS.Verification (green):