Re: [RFC][DISCUSSION] throw expression
| From: | Dan Ackroyd | Date: | Sun, 22 Mar 2020 17:16:19 +0000 |
| Subject: | Re: [RFC][DISCUSSION] throw expression | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109205@lists.php.net to get a copy of this message | ||
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