Closed
Description
From manual page: https://php.net/control-structures.match
EXAMPLE #3 reads:
$output = match (true) {
$age < 2 => "Baby",
$age < 13 => "Child",
$age <= 19 => "Teenager",
$age > 19 => "Young adult",
$age >= 40 => "Old adult"
};
This will fail when $age is above 40 because it will still print "Young adult". It's impossible to get "Old adult" out of the example.
Metadata
Metadata
Assignees
Labels
No labels