Re: [RFC] Default expression

From: Date: Sun, 25 Aug 2024 22:46:15 +0000
Subject: Re: [RFC] Default expression
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On 26.8.2024 00:31:57, Rowan Tommins [IMSoP] wrote:
I'm not an expert on parsers, and never claimed to be, so it's not particularly surprising to me that I've overlooked a reason why "expr ?: default" can't be included without also including "default ?: expr", and will just have to take your word for it. It doesn't, unfortunately, persuade me that the behaviour proposed is sensible. Rowan Tommins [IMSoP]
Hey Rowan, just to state this: It is almost never sensible to arbitrarily restrict grammars. In the sense of "allow this expression just in a context of this given list of expressions". Sure, in some cases the permitted grammar doesn't make sense (like, why would we allow arithmetic operators on the left-hand side of a coalesce operation "($a + $b) ?? $c"), but that's on the user to write a minimal bit of sensible code. I hope you can understand that; thanks, Bob

Thread (101 messages)

« previous php.internals (#125247) next »