Re: [RFC] switch expression
| From: | Ilija Tovilo | Date: | Fri, 27 Mar 2020 12:57:49 +0000 |
| Subject: | Re: [RFC] switch expression | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109372@lists.php.net to get a copy of this message | ||
Hi Gabriel
> This doesn't look like it can do fallbacks which are traditional feature of switch
> statements, can it?
You can take a look at the tests to get a feel for what it’s like:
https://github.com/php/php-src/pull/5308/files
Multiple conditions are possible:
```
return $day switch {
1, 7 => false,
2, 3, 4, 5, 6 => true,
};
```
Regards