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: new MyClass()->method() — dereferencable new without outer parens missing (PHP 8.4, RFC new_without_parentheses) #6974
PHP 8.4 allows dereferencable new expressions — method/property/static access on a freshly constructed object without wrapping the whole expression in parentheses, as long as constructor parentheses are present:
This compiler fails to parse (Syntax error, unexpected T_OBJECT_OPERATOR on the -> after new Class()). Valid programs must keep the old (new Greeter())->greet() form.
Fix:NewDereferenceableDesugar in lib/Ast/ rewrites PHP 8.4 dereferencable new (new Class()->m()) to parenthesized form before nikic/php-parser v4 — same pattern as pipe/in operator desugars. Compiler lowering unchanged.
Activity
PurHur commentedon Jun 6, 2026
claim: worker-lane-c — starting this run
Language: desugar dereferencable new without outer parens (#6974) (#6996
PurHur commentedon Jun 6, 2026
Merged via #6996
Fix:
NewDereferenceableDesugarinlib/Ast/rewrites PHP 8.4 dereferencablenew(new Class()->m()) to parenthesized form before nikic/php-parser v4 — same pattern as pipe/in operator desugars. Compiler lowering unchanged.Verification:
→
hello; PHPUnit OK (8 unit + 2 compliance).Language: gate dereferencable new on 8.4 profile (#19684) (#19692)