MIR0409
ImpossibleLooseComparison
A loose comparison (==) between values of incompatible types that can never be true. This indicates dead code or a logic error.
Example
Section titled “Example”<?phpfunction checkValue($value): bool { if ($value == null && $value === false) { // This can never be true - null and false have different meanings return true; } return false;}How to fix
Section titled “How to fix”Review the comparison logic and remove impossible conditions:
<?phpfunction checkValue($value): bool { // Check for null OR false separately if ($value === null || $value === false) { return true; } return false;}