We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5cac84 commit 6387537Copy full SHA for 6387537
spec.md
@@ -710,7 +710,7 @@ if (
710
}
711
```
712
713
-### 5.2 `switch`, `case`
+### 5.2 `switch`, `case`, `match`
714
715
A `switch` structure looks like the following. Note the placement of
716
parentheses, spaces, and braces. The `case` statement MUST be indented once
@@ -757,6 +757,19 @@ switch (
757
758
759
760
+Similarly, a `match` expression looks like the following. Note the placement
761
+of parentheses, spaces, and braces.
762
+
763
+```php
764
+<?php
765
766
+$returnValue = match ($expr) {
767
+ 0 => 'First case',
768
+ 1, 2, 3 => multipleCases(),
769
+ default => 'Default case',
770
+};
771
+```
772
773
### 5.3 `while`, `do while`
774
775
A `while` statement looks like the following. Note the placement of
0 commit comments