rfc:switch_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:switch_expression [2020/03/28 12:29] – Move to Under Discussion ilijatovilo | rfc:switch_expression [2020/03/28 21:37] – Replace InvalidArgumentException with UnhandledSwitchCaseError ilijatovilo | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== PHP RFC: Switch expression ====== | ====== PHP RFC: Switch expression ====== | ||
* Date: 2020-03-28 | * Date: 2020-03-28 | ||
- | * Author: Ilija Tovilo, | + | * Author: Ilija Tovilo, tovilo.ilija@gmail.com |
* Author: Michał Brzuchalski, | * Author: Michał Brzuchalski, | ||
* Status: Under Discussion | * Status: Under Discussion | ||
Line 138: | Line 138: | ||
</ | </ | ||
- | The unexpected value 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 '' | + | The unexpected value 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 '' |
<code php> | <code php> | ||
Line 218: | Line 218: | ||
$y = $x === 1 ? ... | $y = $x === 1 ? ... | ||
: ($x === 2 ? ... | : ($x === 2 ? ... | ||
- | : (($x === 3 ? ... | + | : ($x === 3 ? ... |
: 0)); | : 0)); | ||
</ | </ |
rfc/switch_expression.txt · Last modified: 2020/04/12 00:04 by ilijatovilo