When a variable is not initialized before its use, it's a sign that the developer made a mistake.
function fun($condition) {
$res = 1;
if ($condition) {
$res++;
}
return $result; // Noncompliant, "$result" instead of "$res"
}
function fun($condition) {
$res = 1;
if ($condition) {
$res++;
}
return $res;
}