checks whether the contents of array a equals those of array b (ignore keys and order but otherwise strict check)

@param  array   $a
@param  array   $b
@return boolean
495406
private function isArrayContentsEqual($a, $b)
    {
        foreach ($b as $one) {
            $pos = array_search($one, $a, true);
            if ($pos === false) {
                return false;
            } else {
                unset($a[$pos]);
            }
        }

        return $a ? false : true;
    }
39482
public static function isEqual($a, $b)
    {
        if ($a === $b) {
            return true;
        } elseif ($a instanceof \stdClass) {
            return self::isEqual((array) $a, $b);
        } elseif ($b instanceof \stdClass) {
            return self::isEqual($a, (array) $b);
        } else {
            return false;
        }
    }
802959
public function compare(Node $a, Node $b) {
    $valA = $this->getSortkeyValue($a);
    $valB = $this->getSortkeyValue($b);
    if ($valA == $valB) { return 0; }
    return ($valA > $valB) ? 1 : -1;
  }
311556
protected function compareNodes($a, $b)
    {
        $typeA = (isset($a['{DAV:}resourcetype']))
            ? (in_array('{DAV:}collection', $a['{DAV:}resourcetype']->getValue()))
            : false;

        $typeB = (isset($b['{DAV:}resourcetype']))
            ? (in_array('{DAV:}collection', $b['{DAV:}resourcetype']->getValue()))
            : false;

        // If same type, sort alphabetically by filename:
        if ($typeA === $typeB) {
            return strnatcasecmp($a['displayPath'], $b['displayPath']);
        }

        return ($typeA < $typeB) ? 1 : -1;
    }
142375
public static function compareVersions($a, $b)
    {
        $versionPos = max(count($a), count($b));
        while (count($a) < $versionPos) {
            $a[] = 0;
        }
        while (count($b) < $versionPos) {
            $b[] = 0;
        }

        for ($v = 0; $v < count($a); $v++) {
            if ((int)$a[$v] < (int)$b[$v]) {
                return '<';
            }
            if ((int)$a[$v] > (int)$b[$v]) {
                return '>';
            }
        }
        return '=';
    }
25645
public function isEqual($a=null, $b=null) {
    list($a, $b) = self::_wrapArgs(func_get_args(), 2);
    
    if(isset($this) && isset($this->_chained) && $this->_chained) $a =& $this;
    
    if($a === $b) return self::_wrap(true);
    if(gettype($a) !== gettype($b)) return self::_wrap(false);
    if(is_callable($a) !== is_callable($b)) return self::_wrap(false);
    
    if($a == $b) return self::_wrap(true);
    
    // Objects and arrays compared by values
    if(is_object($a) || is_array($a)) {
      
      // Do either implement isEqual()?
      if(is_object($a) && isset($a->isEqual)) return self::_wrap($a->isEqual($b));
      if(is_object($b) && isset($b->isEqual)) return self::_wrap($b->isEqual($a));
      if(is_array($a) && array_key_exists('isEqual', $a)) return self::_wrap($a['isEqual']($b));
      if(is_array($b) && array_key_exists('isEqual', $b)) return self::_wrap($b['isEqual']($a));
      
      if(count($a) !== count($b)) return self::_wrap(false);
      
      $__ = new self;
      $keys_equal = $__->isEqual($__->keys($a), $__->keys($b));
      $values_equal = $__->isEqual($__->values($a), $__->values($b));
      return self::_wrap($keys_equal && $values_equal);
    }
    
    return self::_wrap(false);
  }
1216323
private boolean digests_equals(final byte[] a, final byte[] b) {
        int i;
        for (i = 0; i < 16; ++i) {
            if (a[i] != b[i]) {
                return false;
            }
        }
        return true;
    }
1029405
public static function array_compare(&$arr1, &$arr2) {
		// Obviously bad data.
		if (! \is_array($arr1) || ! \is_array($arr2)) {
			return false;
		}

		$length = \count($arr1);

		// Length mismatch.
		if (\count($arr2) !== $length) {
			return false;
		}

		// Different keys, we don't need to check further.
		if (\count(\array_intersect_key($arr1, $arr2)) !== $length) {
			return false;
		}

		// We will ignore keys for non-associative arrays.
		if (
			(cast::array_type($arr1) !== 'associative') &&
			(cast::array_type($arr2) !== 'associative')
		) {
			return \count(\array_intersect($arr1, $arr2)) === $length;
		}

		// Check each item.
		foreach ($arr1 as $k=>$v) {
			if (! isset($arr2[$k])) {
				return false;
			}

			// Recursive?
			if (\is_array($arr1[$k]) && \is_array($arr2[$k])) {
				if (! static::array_compare($arr1[$k], $arr2[$k])) {
					return false;
				}
			}
			elseif ($arr1[$k] !== $arr2[$k]) {
				return false;
			}
		}

		return true;
	}
1305839
private function sortLocalesByPriority(array $a, array $b)
    {
        $a = isset($a['priority']) ? $a['priority'] : 0;
        $b = isset($b['priority']) ? $b['priority'] : 0;

        if ($a === $b) {
            return 0;
        }
        return ($a < $b) ? (-1) : 1;
    }
1271909
public static function isIndexed(array $array)
    {
        $i = 0;
        foreach (array_keys($array) as $k) {
            if ($k !== $i) {
                return false;
            }
            $i++;
        }
        return true;
    }
1234857
static public function arrayTransfer(array $a, array $b)
	{
		if (ArrayUtils::isList($b, ArrayUtils::isList($a)))
		{
			$a = $b;
		}
		else
		{
			foreach ($b as $key => $value)
			{
				if (array_key_exists($key, $a) && is_array($value) && is_array($a[$key]))
				{
					$a[$key] = self::arrayTransfer($a[$key], $value);
				}
				else
				{
					$a[$key] = $value;
				}
			}
		}
		return $a;
	}
290626
public function compare($a, $b)
    {
        return strcoll(Horde_String::lower($a[$this->key], true, 'UTF-8'), Horde_String::lower($b[$this->key], true, 'UTF-8'));
    }
289618
protected function comparePluginPriorities($a, $b)
    {
        if ($this->pluginStorage[$a]['priority'] === $this->pluginStorage[$b]['priority']) {
            return 0;
        }

        return ($this->pluginStorage[$a]['priority'] > $this->pluginStorage[$b]['priority']) ? -1 : 1;
    }
1347864
public static function sortByKeyInt($a, $b, $key) {
    $a_weight = (is_array($a) && isset($a[$key])) ? $a[$key] : 0;
    $b_weight = (is_array($b) && isset($b[$key])) ? $b[$key] : 0;

    if ($a_weight == $b_weight) {
      return 0;
    }

    return ($a_weight < $b_weight) ? -1 : 1;
  }
839608
public static function compare($a, $b)
    {
        if ($a->getRow() == $b->getRow()) {
            return $a->getCell() - $b->getCell();
        }

        return $a->getRow() - $b->getRow();
    }
222128
protected boolean arraysEqual(Object[] a1, Object[] a2) {
		if (a1 != null && a2 != null && a1.length == a2.length) {
			// Loop over each element and compare them using our comparator
			for (int i = 0; i < a1.length; i++) {
				if (!equalByComparator(a1[i], a2[i])) {
					return false;
				}
			}
			return true;
		}
		else if (a1 == null && a2 == null) {
			return true;
		}
		return false;
	}
878595
public static function equal(array $array1, array $array2)
    {
        if (static::count($array1) != static::count($array2)) {
            return false;
        } else {
            for ($i = 0; $i < static::count($array1); $i++) {
                if ($array1[$i] != $array2[$i]) {
                    return false;
                }
            }
        }

        return true;
    }