Re: [RFC][DISCUSSION] throw expression
| From: | Ilija Tovilo | Date: | Wed, 25 Mar 2020 19:37:02 +0000 |
| Subject: | Re: [RFC][DISCUSSION] throw expression | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109311@lists.php.net to get a copy of this message | ||
Hi Andrea
> I would think we can just give
throw an appropriate precedence
> so that expressions like the above do what is desired
The example are taken from the RFC online. The following expression is already possible:
```php
throw $condition1 && $condition2 ? new Exception1() : new Exception2();
```
To make sure it keeps working the precedence needs to me very low. Thus the precedence might be
slightly surprising which is why Dan suggests printing a warning.
Regards