Re: [RFC] Match expression
| From: | Theodore Brown | Date: | Sun, 10 Sep 2017 19:16:47 +0000 |
| Subject: | Re: [RFC] Match expression | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100507@lists.php.net to get a copy of this message | ||
On Sunday, September 10, 2017 12:45 PM Rowan Collins <rowan.collins@gmail.com> wrote:
>>> Would it be possible to add an optional
$strict
>>> parameter to
>>> switch? E.g.
>>> ```
>>> switch ($i, true) {
>>
>> I'd very much prefer a "strict switch ($i) { ... }" over a second parameter.
>
> What do either of you think of my "switch-use" proposal, which would spell this as
> "switch ($i) use (===)"?
That seems more complicated and confusing than either of the other options. Normally
use() is for inheriting variables in anonymous functions.