Skip to content

MIR0409

ImpossibleLooseComparison

A loose comparison (==) between values of incompatible types that can never be true. This indicates dead code or a logic error.

<?php
function checkValue($value): bool {
if ($value == null && $value === false) {
// This can never be true - null and false have different meanings
return true;
}
return false;
}

Review the comparison logic and remove impossible conditions:

<?php
function checkValue($value): bool {
// Check for null OR false separately
if ($value === null || $value === false) {
return true;
}
return false;
}