See that two times match.

@param string $t1
@param string $t2
345212
public function seeTimeMatches($t1, $t2) {
        \PHPUnit_Framework_Assert::assertTrue($this->_ParseDate($t1)->eq($this->_ParseDate($t2)));
    }
69497
public static function compare($date1, $date2, $type = 'date') {
		if ($type == 'date') {
			return date('Y-m-d', strtotime($date1)) === date('Y-m-d', strtotime($date2));
		} else if ($type == 'datetime' || $type == 'time') {
			return date('Y-m-d H:i:s', strtotime($date1)) === date('Y-m-d H:i:s', strtotime($date2));
		} else {
			return strtotime($date1) == strtotime($date2);
		}
	}
809727
public static function match($scenario1, $scenario2)
	{
		$match1 = $match2 = [];
		if ( preg_match_all('/([^\\}{]*)\{([^\{\}]+)\}/', $scenario1, $match1, PREG_SET_ORDER) &&
			   preg_match_all('/([^\\}{]*)\{([^\{\}]+)\}/', $scenario2, $match2, PREG_SET_ORDER) ) {

			if ( count($match1) != count($match2) ) {
				return false;
			}
			for ($i = 0; $i < count($match1); $i++) {
				if ( str_replace(' ', '', $match1[$i][1]) != str_replace(' ', '', $match2[$i][1]) ) {
					return false;
				}
				if ( $match1[$i][2] != $match2[$i][2] &&  $match1[$i][2] != '*' && $match2[$i][2] != '*' ) {
					return false;
				}
			}
		} else {
			return false;
		}
		return true;
	}
180065
public static <T extends Comparable> int compare(@Nullable T first, @Nullable T second) {
        return compare(first, second, Comparable::compareTo);
    }
1360715
public function similarity($text1, $text2) 
    {
        if(is_string($text1) && is_string($text2)) {
            $text1 = str_split($text1);
            $text2 = str_split($text2);
        }         
        $inter = array_intersect( $text1, $text2 );
        $union = array_unique( ($text1 + $text2) );
        return count($inter) / count($union);                
    }
22931
public static function compare($date1, $date2): int
    {
        $d1 = static::create($date1);
        $d2 = static::create($date2);

        return ($d1 > $d2) ? static::DATETIME_GREATER : (($d1 < $d2) ? static::DATETIME_LESS : static::DATETIME_EQUAL);
    }
924466
public static function areEqual($value1, $value2): bool
    {
        if (static::isEquatable($value1) && static::areSameType($value1, $value2)) {
            return $value1->equals($value2);
        }

        return $value1 == $value2;
    }
1227377
public static function compareStr($str1, $str2) {
		$len1 = static::binaryStrlen($str1);
		$len2 = static::binaryStrlen($str2);
		$len = min($len1, $len2);
		$diff = $len1 ^ $len2;

		for ($i = 0; $i < $len; $i++) {
			$diff |= ord($str1[$i]) ^ ord($str2[$i]);
		}

		return $diff === 0;
	}
1350042
public static function switcheroo(&$var1, &$var2) {
		$tmp = $var1;
		$var1 = $var2;
		$var2 = $tmp;

		return true;
	}
908865
public static function Equal ($string1, $string2, $encoding = Encoding::DEFAULT_ENCODING) {
		return (self::Compare($string1, $string2, $encoding) === 0);
	}
1239664
public function compare($priority1, $priority2)
    {
        if (!$priority1 instanceof EventQueuePriority || !$priority2 instanceof EventQueuePriority) {
            return parent::compare($priority1, $priority2);
        }

        $priority = $priority1->value - $priority2->value;
        if (!$priority) {
            $priority = $priority2->timestamp - $priority1->timestamp;
        }
        return $priority;
    }
408485
private boolean isTimeAfterOrEquals(Calendar time1, Calendar time2) {
        return !(time1 == null || time2 == null) && time1.getTimeInMillis() >= time2.getTimeInMillis();
    }
1237393
protected function compare($value1, $value2)
	{
		$haystack = [
			'y',
			'ignore_unknown',
			'stream_loop',
			'sseof',
			'itsoffset',
			'thread_queue_size',
			'seek_timestamp',
			'accurate_seek',
			'noaccurate_seek',
			'ss',
			'seek_start',
			'i',
			'input',
		
		];
		
		if (($value1 = array_search(ltrim($value1[0], '-'), $haystack, false)) !== false)
		{
			return ($value2 = array_search(ltrim($value2[0], '-'), $haystack)) !== false && $value1 > $value2 ? -1 : 1;
		}
		
		return -1;
	}
797466
protected function r2()
    {
        list($index, $value) = $this->rx($this->r1);

        $this->r2 = $value;
        $this->r2Index = $this->r1Index + $index;
    }
1075955
@Override
    public R apply(T1 first, T2 second) {
        interceptor.before(first, second);
        try {
            return inner.apply(first, second);
        } finally {
            interceptor.after(first, second);
        }
    }
470010
public static function compareDatetime($a, $b)
    {
        $timea = strtotime($a);
        $timeb = strtotime($b);

        if ($timea === false || $timeb === false) {
            return false;
        }

        if ($timea > $timeb) {
            return 1;
        } elseif ($timea < $timeb) {
            return -1;
        }

        return 0;
    }
1179950
protected static function _compareRDFTriples($t1, $t2) {
    foreach(array('subject', 'predicate', 'object') as $attr) {
      if($t1->{$attr}->type !== $t2->{$attr}->type ||
        $t1->{$attr}->value !== $t2->{$attr}->value) {
        return false;
      }
    }
    if(property_exists($t1->object, 'language') !==
      property_exists($t1->object, 'language')) {
      return false;
    }
    if(property_exists($t1->object, 'language') &&
      $t1->object->language !== $t2->object->language) {
      return false;
    }
    if(property_exists($t1->object, 'datatype') &&
      $t1->object->datatype !== $t2->object->datatype) {
      return false;
    }
    return true;
  }