TextEqual
@param string $a
@param string $b
@return bool
503666
protected function TextEqual( $a, $b )
	{

		if ( $this->excludeWhitespace )
			return strcasecmp( CoreFuncs::Normalizespace( $a ), CoreFuncs::Normalizespace( $b ) ) == 0;
		else
			return strcasecmp( $a, $b ) == 0;
	}
835430
protected static function hashEquals($a, $b)
    {
        if (function_exists('hash_equals')) {
            return hash_equals($a, $b);
        }
        $nonce = openssl_random_pseudo_bytes(32);
        return hash_hmac(self::HASH_ALGO, $a, $nonce) === hash_hmac(self::HASH_ALGO, $b, $nonce);
    }
1320735
function regexpEqual(a, b) {
  if ('regexp' !== type(b)) return false;
  return sameValue(a.toString(), b.toString());
}
811853
def deep_equal(a, b):
    
    if is_any_string_type(a) and is_any_string_type(b):
        if isinstance(a, six.binary_type):
            a = six.text_type(a, encoding='utf-8')
        if isinstance(b, six.binary_type):
            b = six.text_type(b, encoding='utf-8')
        return a == b
    return a == b and isinstance(a, type(b)) and isinstance(b, type(a))
1188471
public static function compare(Match $a, Match $b)
    {
        if ($a->quality !== $b->quality) {
            return $a->quality > $b->quality ? -1 : 1;
        }

        if ($a->index !== $b->index) {
            return $a->index > $b->index ? 1 : -1;
        }

        return 0;
    }
539470
def equal(self, a, b, message=None):
        ""
        if a != b:
            self.log_error("{} != {}".format(str(a), str(b)), message)
            return False
        return True
1288459
public function equals($text): bool
    {
        if (!($text instanceof Text)) {
            return false;
        }

        return $this->text === $text->text;
    }
1269693
private function compareBcStrings(string $a, string $b) : int
    {
        $a_len = strlen($a);
        $b_len = strlen($b);

        if ($a_len > $b_len) {
            return -1;
        }

        if ($a_len < $b_len) {
            return 1;
        }

        $a_len = strlen(str_replace(['*', '?'], '', $a));
        $b_len = strlen(str_replace(['*', '?'], '', $b));

        if ($a_len > $b_len) {
            return -1;
        }

        if ($a_len < $b_len) {
            return 1;
        }

        return 0;
    }
513970
function _equals(a, b) {
    if (a === b) {
        return true;
    }

    const aType = $type(a);

    if (aType != $type(b)) {
        return false;
    }

    if (aType == 'array') {
        return _arrEquals(a, b);
    }

    if (aType == 'object') {
        return _objEquals(a, b);
    }

    if (aType == 'date') {
        return +a == +b;
    }

    return false;
}
1155253
public function compare(DecimalNumber $a, DecimalNumber $b)
    {
        if (function_exists('bccomp')) {
            return $this->compareUsingBcMath($a, $b);
        }

        return $this->compareWithoutBcMath($a, $b);
    }
641558
public static boolean contains(CharSequence a, CharSequence b) {
        return contains(a, b, DefaultCharEqualityComparator.INSTANCE);
    }
950952
private boolean isEqual(Object a, Object b) {

        if (a == null) {
            return (b == null);
        }
        if (b == null) {
            return false;
        }
        return a.equals(b);
    }
1106205
public function isEqual(Money $a, Money $b) : bool
    {
        return $this->compare($a, $b) === 0;
    }
294200
public function isGreaterOrEqual(Money $a, Money $b) : bool
    {
        return $this->compare($a, $b) >= 0;
    }
1013241
public function isLessOrEqual(Money $a, Money $b) : bool
    {
        return $this->compare($a, $b) <= 0;
    }
432909
public function similarity($text1, $text2)
    {
        $similarity = 0;
        $hash1 = $this->hashString($text1);
        $hash2 = $this->hashString($text2);        
        
        $keys = array_keys(array_intersect_key($hash1, $hash2));
        foreach($keys as $key)
        {
            if($hash1[$key] === $hash2[$key] && $hash1[$key] >= $this->limit)
            {
                $similarity += $hash1[$key];
            }
        }        
        return $similarity;
    }
997486
protected function compare($a, $b)
    {
        switch ($this->operator) {
            case '=':
            case '==': return $a == $b;
            case '!=': return $a != $b;
            case '<':  return $a < $b;
            case '>':  return $a > $b;
            case '<=': return $a <= $b;
            case '>=': return $a >= $b;
        }
    }