rfc:match_expression
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:match_expression [2020/04/24 20:19] – Remove unused sentence ilijatovilo | rfc:match_expression [2020/04/25 08:09] – Add switch expression to failed reason ilijatovilo | ||
---|---|---|---|
Line 212: | Line 212: | ||
</ | </ | ||
- | For the time being the following code will result | + | For the time being using blocks in match expressions that use the return value in any way results |
<code php> | <code php> | ||
Line 218: | Line 218: | ||
0 => {}, | 0 => {}, | ||
}; | }; | ||
+ | //> Match that is not used as a statement can't contain blocks | ||
- | //> Match that not used as a statement can't contain blocks | + | foo(match ($x) { |
+ | 0 => {}, | ||
+ | }); | ||
+ | //> Match that is not used as a statement can't contain blocks | ||
+ | |||
+ | 1 + match ($x) { | ||
+ | 0 => {}, | ||
+ | }; | ||
+ | //> Match that is not used as a statement can't contain blocks | ||
+ | |||
+ | //etc. | ||
+ | |||
+ | // Only allowed form | ||
+ | match ($x) { | ||
+ | 0 => {}, | ||
+ | } | ||
</ | </ | ||
Line 261: | Line 277: | ||
</ | </ | ||
- | When '' | + | A '' |
<code php> | <code php> | ||
Line 534: | Line 550: | ||
5. Missing explicit fallthrough | 5. Missing explicit fallthrough | ||
6. BC break is not acceptable | 6. BC break is not acceptable | ||
- | 7. Other | + | 7. Wanted [[https:// |
+ | 8. Other | ||
<doodle title=" | <doodle title=" | ||
Line 544: | Line 561: | ||
* 6 | * 6 | ||
* 7 | * 7 | ||
+ | * 8 | ||
</ | </ | ||
rfc/match_expression.txt · Last modified: 2020/05/09 15:59 by ilijatovilo