Bug report
When using PHP 8 named parameters, a false Dead Catch warning appears e.g.
try {
$parsed = json_decode($contents, true, flags: JSON_BIGINT_AS_STRING | JSON_OBJECT_AS_ARRAY | JSON_THROW_ON_ERROR);
} catch (JsonException $exception) {
throw new InvalidArgumentException('Unable to decode contents');
}
results in the error: Dead catch - JsonException is never thrown in the try block.
Code snippet that reproduces the problem
https://phpstan.org/r/35f161ee-735a-4e62-ad36-0fd22b255300
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
I haven't been able to not use this tool since I first started way back when.
Bug report
When using PHP 8 named parameters, a false Dead Catch warning appears e.g.
results in the error:
Dead catch - JsonException is never thrown in the try block.Code snippet that reproduces the problem
https://phpstan.org/r/35f161ee-735a-4e62-ad36-0fd22b255300
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
I haven't been able to not use this tool since I first started way back when.