Re: [RFC] Paren- less access to scalar exte nsion methods ('a,b'->arr as sugar for 'a,b'->arr())

From: Date: Sat, 24 Oct 2026 13:26:06 +0000
Subject: Re: [RFC] Paren- less access to scalar exte nsion methods ('a,b'->arr as sugar for 'a,b'->arr())
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-132915@lists.php.net to get a copy of this message
On 24 October 2026 10:33:53 BST, 497161114 <h4acda@qq.com> wrote: >Hi, > > >This follows up on the Extension Methods / Scalar Extension Methods RFCs (currently in draft). >I'd like to propose allowing extension methods on scalar values to be invoked through >property-fetch syntax, with the parentheses omitted. Hi, I'd be a strong -1 on this. It seems like an entirely arbitrary rule, to save two characters per call, making the language less consistent, and closing off syntax that might be useful for something else in future. It also seems odd to propose it now, as an extension to something that doesn't even exist yet. Surely there are much more "critical path" details of extension and scalar methods that we need to iron out before thinking about such extra sugar? Regards, Rowan Tommins [IMSoP]

« previous php.internals (#132915) next »