1.2.1405. Uses PHP 8 Match()¶
Use the match() syntax.
<?php
$A = match($a) {
'a' => 'A',
'b' => 'B',
default => 'd',
};
?>
See also match and Match expression.
1.2.1405.1. Specs¶
Short name |
Php/UseMatch |
Rulesets |
|
Exakat since |
2.1.4 |
PHP Version |
With PHP 8.0 and more recent |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Features |
match |
Related rule |
|
Available in |