rfc:match_expression_v2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:match_expression_v2 [2020/05/21 13:59] – Improve examples ilijatovilo | rfc:match_expression_v2 [2020/07/09 22:06] (current) – Move to implemented ilutov | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Match expression v2 ====== | ====== PHP RFC: Match expression v2 ====== | ||
- | * Date: 2020-05-16 | + | * Date: 2020-05-22 |
* Author: Ilija Tovilo, tovilo.ilija@gmail.com | * Author: Ilija Tovilo, tovilo.ilija@gmail.com | ||
- | * Status: | + | * Status: |
* Target Version: PHP 8.0 | * Target Version: PHP 8.0 | ||
* Implementation: | * Implementation: | ||
Line 121: | Line 121: | ||
}; | }; | ||
</ | </ | ||
- | Multiple conditions can be comma-separated to execute the same block of code. There’s no way to achieve the same result as 3 and 4. | + | Multiple conditions can be comma-separated to execute the same block of code. |
<code php> | <code php> | ||
Line 142: | Line 142: | ||
// Forgot to handle BinaryOperator:: | // Forgot to handle BinaryOperator:: | ||
</ | </ | ||
- | This will go unnoticed until the program crashes in a weird way, causes strange behavior or even worse becomes a security hole. Many languages can check if all the cases are handled at compile time or force you to write a '' | + | This will go unnoticed until the program crashes in a weird way, causes strange behavior or even worse becomes a security hole. '' |
<code php> | <code php> | ||
Line 149: | Line 149: | ||
}; | }; | ||
- | // Throws when $operator is BinaryOperator:: | + | // Throws when $operator is BinaryOperator:: |
</ | </ | ||
===== Miscellaneous ===== | ===== Miscellaneous ===== | ||
Line 192: | Line 192: | ||
Note that it will continue to work in method names and class constants. | Note that it will continue to work in method names and class constants. | ||
+ | |||
+ | ===== Syntax comparison ===== | ||
+ | https:// | ||
===== Vote ===== | ===== Vote ===== | ||
- | Voting | + | Voting |
+ | As this is a language change, a 2/3 majority is required. | ||
+ | <doodle title=" | ||
+ | * Yes | ||
+ | * No | ||
+ | </ |
rfc/match_expression_v2.1590069546.txt.gz · Last modified: 2020/05/21 13:59 by ilijatovilo