HH\Lib\Str\compare

This API is part of the Hack Standard Library, not HHVM itself.
Facebook Engineer?

This function is available as Str\compare() in Facebook's www repository.

Returns < 0 if $string1 is less than $string2, > 0 if $string1 is greater than $string2, and 0 if they are equal

Description

namespace HH\Lib\Str;

function compare(
  string $string1,
  string $string2,
): int;

For a case-insensitive comparison, see Str\compare_ci().

Parameters

  • string $string1
  • string $string2