function eq()

in src/legacy_fixme/coercions.php [166:177]


function eq(mixed $l, mixed $r)[]: bool {
  // avoid doing slow checks in super common case
  if (
    ($l is int && $r is int) ||
    ($l is float && $r is float) ||
    ($l is bool && $r is bool) ||
    ($l is string && $r is string && (!\is_numeric($l) || !\is_numeric($r)))
  ) {
    return $l == $r;
  }
  return __cast_and_compare($l, $r, COMPARISON_TYPE::EQ) === 0;
}