We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cadf3a2 + 6387537 commit 89fbefaCopy full SHA for 89fbefa
spec.md
@@ -791,7 +791,7 @@ if (
791
}
792
```
793
794
-### 5.2 `switch`, `case`
+### 5.2 `switch`, `case`, `match`
795
796
A `switch` structure looks like the following. Note the placement of
797
parentheses, spaces, and braces. The `case` statement MUST be indented once
@@ -838,6 +838,19 @@ switch (
838
839
840
841
+Similarly, a `match` expression looks like the following. Note the placement
842
+of parentheses, spaces, and braces.
843
+
844
+```php
845
+<?php
846
847
+$returnValue = match ($expr) {
848
+ 0 => 'First case',
849
+ 1, 2, 3 => multipleCases(),
850
+ default => 'Default case',
851
+};
852
+```
853
854
### 5.3 `while`, `do while`
855
856
A `while` statement looks like the following. Note the placement of
0 commit comments