Compare two log levels.

@param string $a The first log level to compare.
@param string $b The second log level to compare.
@return int Returns -1, 0, or 1.
184699
private function compareLevel(string $a, string $b): int {
        $i = array_search($a, static::$levels);
        if ($i === false) {
            throw new InvalidArgumentException("Log level is invalid: $a", 500);
        }

        return $i <=> array_search($b, static::$levels);
    }
357885
private function _compareMac($a, $b) {
        $result = "\x00";

        for ($i = 0; $i < $this->_macByteCount; $i++) {
            $result |= substr($a, $i, 1) ^ substr($b, $i, 1);
        }
        
        /* \x00 if equal, nonzero otherwise */
        return ($result === "\x00");
    }
898483
public static function compareResourceRecords(ResourceRecord $a, ResourceRecord $b): int
    {
        if ($a->getType() === $b->getType()) {
            return strcmp($a->getName().$a->getRdata()->output(), $b->getName().$b->getRdata()->output());
        }

        $_a = array_search($a->getType(), self::$order);
        $_b = array_search($b->getType(), self::$order);

        if (false !== $_a && false !== $_b) {
            return $_a - $_b;
        }

        if (false === $_a) {
            return 1;
        }

        return -1;
    }
809796
public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
    {
        if ($a->getRow() < $b->getRow()) {
            return -1;
        } elseif ($a->getRow() > $b->getRow()) {
            return 1;
        } elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) {
            return -1;
        } else {
            return 1;
        }
    }
836161
private static int compareInt(final int a, final int b) {
		int result = 0;
		if (a > b) {
			result = 1;
		} else if (a < b) {
			result = -1;
		}
		return result;
	}
146564
public function sortMenuEntries($a, $b)
    {
        if ($a->getName() > $b->getName()) {
            return 1;
        } else if ($a->getName() < $b->getName()) {
            return -1;
        } else {
            return 0;
        }
    }
654565
private function sort($a, $b)
    {
        $result = $this->compareCategories($a->getCategoryId(), $a->getSubcategoryId(), $a->getOrder(), $b->getCategoryId(), $b->getSubcategoryId(), $b->getOrder());

        // if categories are equal, sort by ID
        if (!$result) {
            $aId = $a->getId();
            $bId = $b->getId();

            if ($aId == $bId) {
                return 0;
            }

            return $aId < $bId ? -1 : 1;
        }

        return $result;
    }
1032341
public int compare(String a, String b) {

        int i;

        if (collator == null) {
            i = a.compareTo(b);
        } else {
            i = collator.compare(a, b);
        }

        return (i == 0) ? 0
                        : (i < 0 ? -1
                                 : 1);
    }
1035729
public function compareUsingBcMath(DecimalNumber $a, DecimalNumber $b)
    {
        return bccomp((string) $a, (string) $b, max($a->getExponent(), $b->getExponent()));
    }
576655
public static function compare(Symbol $a, Symbol $b): int
    {
        return ($a->isTerminal - $b->isTerminal)
            ?: strcmp($a->name, $b->name);
    }
693134
protected function tokensEqual($a, $b)
    {
        if (is_string($a) && is_string($b)) {
            return $a === $b;
        } elseif (isset($a[0], $a[1], $b[0], $b[1])) {
            return $a[0] === $b[0] && $a[1] == $b[1];
        }

        return false;
    }
418895
protected static function sortByOrder($a, $b) {
        if(!isset($a['link_order']) && isset($b['link_order'])){$a['link_order'] = ($b['link_order'] + 1);}
        if(!isset($b['link_order']) && isset($a['link_order'])){$b['link_order'] = ($a['link_order'] + 1);}
        if(isset($a['link_order']) && isset($b['link_order']) && is_numeric($a['link_order']) && is_numeric($b['link_order'])){
            return intval($a['link_order']) - intval($b['link_order']);
        }
        return 0;
    }
149541
protected function sortCompareValues($a, $b)
    {
        if (is_numeric($a) && is_numeric($b)) {
            return $this->sortCompareNumeric((float)$a, (float)$b);
        }

        if (is_string($a) && is_string($b)) {
            return $this->sortCompareStrings($a, $b);
        }

        return ($a < $b) ? -1 : (int)($a > $b);
    }
349467
public function Compare($a, $b)
    {
        $this->preOpMethodParamsCheck(array($a, $b));

        return $this->math->comp($a, $b);
    }
1281841
public static function intcmp($a, $b) {
		return ($a - $b) ? ($a - $b) / abs($a - $b) : 0;
	}
187555
private function compareSearchWeights(Content $a, Content $b)
    {
        if ($a->getSearchResultWeight() > $b->getSearchResultWeight()) {
            return -1;
        }
        if ($a->getSearchResultWeight() < $b->getSearchResultWeight()) {
            return 1;
        }
        if ($a['datepublish'] > $b['datepublish']) {
            // later is more important
            return -1;
        }
        if ($a['datepublish'] < $b['datepublish']) {
            // earlier is less important
            return 1;
        }

        return strcasecmp($a['title'], $b['title']);
    }
540777
public function compare(NumericTypeInterface $a, NumericTypeInterface $b)
    {
        return $this->compEngine->compare($a, $b);
    }