function cmp()

in src/legacy_fixme/coercions.php [151:159]


function cmp(mixed $l, mixed $r)[]: int {
  // avoid doing slow checks in super common case
  if ($l is string && $r is string) {
    return $l <=> $r;
  } else if ($l is num && $r is num) {
    return $l <=> $r;
  }
  return __cast_and_compare($l, $r, COMPARISON_TYPE::CMP);
}