diff --git a/spec.md b/spec.md index 66dbad4..a0166b5 100644 --- a/spec.md +++ b/spec.md @@ -710,7 +710,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 @@ -757,6 +757,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