Description
<?php
function foo(string $str)
{
return match ($str) {
'foo' => 'bar',
321 => 'x'
};
}
The type of $str is known to be string which means 321 in the match clause can never be reached, since match uses identity checks (===).
Maybe issue a warning ?
Use case
better intellisense
Proposed solution
No response
Alternatives considered
No response
Code example
Description
The type of
$stris known to be string which means321in the match clause can never be reached, since match uses identity checks (===).Maybe issue a warning ?
Use case
better intellisense
Proposed solution
No response
Alternatives considered
No response
Code example