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: new Class()->method() accepted on default 8.2 profile — Zend parse error (re-#22783, Zend/zend_language_parser.y) #24883
language · php-src-strict · profile-gated syntax (PHP 8.4)
Problem
On the default (8.2) profile, new DateTimeImmutable('…')->format(…) (constructor args, no extra parentheses around new) is accepted and runs. Zend 8.2 parse-rejects it. PHP 8.4 added this form; it must stay behind PHP_COMPILER_PROFILE=8.4 (or equivalent), not leak onto the default profile.
Repro
Zend 8.2 (2026-07-29)
VM / JIT default
echo new DateTimeImmutable('2020-01-01')->format('Y');
Parse error: unexpected token "->" (exit 255)
2020 (exit 0)
Same leak for new stdClass()->foo. Previously fixed as #22783 / #19684; regresses again.
claim: compile-link-trust-gate automation — starting this run (lane B). Pillar 1 probe: inventory OK 6635/6635; release-readiness user_release_ready=yes; north-star5-fast ok. Reproing default-profile new Class()->method() leak vs Zend 8.2 parse reject.
Fix:supportsDereferencableNewWithoutOuterParens() now uses languageProfileVersion() (same pattern as #24818 property hooks). Default / unset PROFILE and PROFILE=8.2 parse-reject new Foo()->bar; PROFILE=8.4 still accepts.
Activity
PurHur commentedon Jul 29, 2026
Maintainer note — pillar-1 probe (same run as filing)
#10533comments are locked (>2500), so recording here:BcMathNumberToString.php)user_release_readySibling filings this run: #24884, #24885, #24886. Merged compliance PR #24880 (JITTest baseline + suite-scoped quarantine).
PurHur commentedon Jul 29, 2026
claim: compile-link-trust-gate automation — starting this run (lane B). Pillar 1 probe: inventory OK 6635/6635; release-readiness user_release_ready=yes; north-star5-fast ok. Reproing default-profile
new Class()->method()leak vs Zend 8.2 parse reject.PurHur commentedon Jul 29, 2026
claim: worker-lane-B — starting this run
Pillar-1 probe (this harness, before claim):
new Foo()->baron default 8.2)Language: reject new Class()->method() on default 8.2 reference profi…
PurHur commentedon Jul 29, 2026
Merged #24898
Fix:
supportsDereferencableNewWithoutOuterParens()now useslanguageProfileVersion()(same pattern as #24818 property hooks). Default / unset PROFILE andPROFILE=8.2parse-rejectnew Foo()->bar;PROFILE=8.4still accepts.Verified:
php bin/vm.php test/repro/issue_24883_new_without_parens_default_profile.php→ parse error RC 255PHP_COMPILER_PROFILE=8.4→2020RC 0new Builder()->build()reject on default,builton 8.4PurHur commentedon Jul 29, 2026
Merged #24899
Verification
PROFILE=8.2VM+JIT:Parse error: … unexpected token "->"(rc 255)PROFILE=8.4VM:2020(rc 0); JIT simplenew Builder()->build()→builtNewDereferenceableSyntaxRejectorTest+ gate tests OKnew_without_parens_default_profileVMTest+JITTest OKGate now uses
languageProfileVersion()(notisForwardProfileAtLeast) — same pattern as #24818 property hooks.