When a variable is not initialized before its use, it's a sign that the developer made a mistake.

Noncompliant Code Example

function fun($condition) {
  $res = 1;
  if ($condition) {
    $res++;
  }
  return $result; // Noncompliant, "$result" instead of "$res"
}

Compliant Solution

function fun($condition) {
  $res = 1;
  if ($condition) {
    $res++;
  }
  return $res;
}

See