diff --git a/spec.md b/spec.md index 9df593c..0652335 100644 --- a/spec.md +++ b/spec.md @@ -791,7 +791,7 @@ if ( } ``` -### 5.2 `switch`, `case` +### 5.2 `switch`, `case`, `match` A `switch` structure looks like the following. Note the placement of parentheses, spaces, and braces. The `case` statement MUST be indented once @@ -838,6 +838,19 @@ switch ( } ``` +Similarly, a `match` expression looks like the following. Note the placement +of parentheses, spaces, and braces. + +```php + 'First case', + 1, 2, 3 => multipleCases(), + default => 'Default case', +}; +``` + ### 5.3 `while`, `do while` A `while` statement looks like the following. Note the placement of