Re: [RFC][DISCUSSION] throw expression
| From: | Ilija Tovilo | Date: | Sun, 22 Mar 2020 18:20:47 +0000 |
| Subject: | Re: [RFC][DISCUSSION] throw expression | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109207@lists.php.net to get a copy of this message | ||
Hi Dan
Interesting suggestion. I'll have to think more about how many of these variations there are
and if there's an easy way to recognize them.
Ilija
On 22.03.20, 18:16, "Dan Ackroyd" <Danack@basereality.com> wrote:
On Sun, 22 Mar 2020 at 16:17, Ilija Tovilo <ilija.tovilo@me.com> wrote:
>
> Due to the modest feedback I’d like to move the throw expression RFC to “under
> discussion”.
>
> https://wiki.php.net/rfc/throw_expression
>
Regarding the example:
$condition || throw new Exception('$condition must be truthy')
&& $condition2 || throw new Exception('$condition2 must be truthy');
The "Deprecate left-associative ternary operator"* RFC made it so that
parentheses are required when ternary operators are nested in
complicated statements.
Would a similar requirement for parentheses around complicated throw
expressions be a suitable solution to avoid people being surprised by
the behaviour?
cheers
Dan
Ack
* https://wiki.php.net/rfc/ternary_associativity