PHPStan 1.8.8
Code snippet:
<?php declare(strict_types = 1);
function phone_number_starts_with_zero(string $phone_number): bool
{
return $phone_number && $phone_number[0] === '0';
}
echo phone_number_starts_with_zero('0123');
// will output 1
But this snippet reports:
5 | Result of && is always false.
5 | Strict comparison using === between non-falsy-string and '0' will always evaluate to false.
https://phpstan.org/r/0d337745-d070-4eba-9bd2-00b6fdac4f7c
This is a regression. It didn't report this issue before.