This function is used to sort the tags in the cloud.

@param   string $a Tag name to compare against $b
@param   string $b Tag name to compare against $a
@return  int    The result of the comparison/validation 1, 0 or -1
552267
public static function cloud_sort($a, $b) {
        $tagsort = self::$cloudsortfield ?: 'name';

        if (is_numeric($a->$tagsort)) {
            return ($a->$tagsort == $b->$tagsort) ? 0 : ($a->$tagsort > $b->$tagsort) ? 1 : -1;
        } else if (is_string($a->$tagsort)) {
            return strcmp($a->$tagsort, $b->$tagsort);
        } else {
            return 0;
        }
    }
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;
    }
1277586
protected function sortActionsByPriority(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;
    }
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;
    }
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'));
    }
230082
protected static function uksortMatchFunc($a, $b)
	{
		$posa = array_search($a, self::$uksortMatchList);
		$posb = array_search($b, self::$uksortMatchList);
		if ($posa == $posb) {
			return 0;
		} else {
			return $posa > $posb ? 1 : -1;
		}
	}
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);
    }
320586
protected static function _sortObjects(&$a, &$b)
  {
    $key = self::$sortKey;

    for($i=0, $count=count($key); $i<$count; $i++){
      if ( isset(self::$sortDirection[$i]) ){
        $direction = self::$sortDirection[$i];
      }

      if ( isset(self::$sortCase[$i]) ){
        $caseSensitive = self::$sortCase[$i];
      }

      if ( isset(self::$sortLocale[$i]) ){
        $locale = self::$sortLocale[$i];
      }

      $va = $a->$key[$i];
      $vb = $b->$key[$i];

      if ( (is_bool($va) or is_numeric($va)) and (is_bool($vb) or is_numeric($vb)) ){
        $cmp = $va - $vb;
      }
      elseif ( $caseSensitive ){ 
        $cmp = strcmp($va, $vb, $locale);
      }
      else {
        $cmp = strcasecmp($va, $vb, $locale);
      }

      if ( $cmp > 0 ){

        return $direction;
      }

      if ( $cmp < 0 ){
        return -$direction;
      }
    }

    return 0;
  }
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;
    }
1240633
protected function compare($a, $b)
    {
        if (is_null($this->comparator)) {
            if ($a < $b) {
                return -1;
            }
            if ($a > $b) {
                return 1;
            }
            return 0;
        }

        return call_user_func($this->comparator, $a, $b);
    }
545769
public static function sort(ServiceDeliveryInterface $a, ServiceDeliveryInterface $b)
    {
        if ($a->getPriority() === $b->getPriority()) {
            return 0;
        }

        return $a->getPriority() > $b->getPriority() ? -1 : 1;
    }
351494
private function usort_sitemap( $a , $b ){
		$page_info_a = $this->get_page_info( $a );
		$page_info_b = $this->get_page_info( $b );
		$orderby_a = $page_info_a['orderby'];
		$orderby_b = $page_info_b['orderby'];
		if( strlen( $orderby_a ) && !strlen( $orderby_b ) ){
			return	-1;
		}elseif( strlen( $orderby_b ) && !strlen( $orderby_a ) ){
			return	1;
		}elseif( $orderby_a < $orderby_b ){
			return	-1;
		}elseif( $orderby_a > $orderby_b ){
			return	1;
		}
		return	0;
	}
486331
protected static function sortGroupList(Node $a, Node $b)
  {
    if(get_class($a) != get_class($b))
    {
      return 0;

      /* workaround for PHP bug #50688 */
      throw new Exception("invalid parameter", 0x602);
    }

    if(!$a instanceof Servergroup && !$a instanceof Channelgroup)
    {
      return 0;

      /* workaround for PHP bug #50688 */
      throw new Exception("convert error", 0x604);
    }

    if($a->getProperty("sortid", 0) != $b->getProperty("sortid", 0) && $a->getProperty("sortid", 0) != 0 && $b->getProperty("sortid", 0) != 0)
    {
      return ($a->getProperty("sortid", 0) < $b->getProperty("sortid", 0)) ? -1 : 1;
    }

    return ($a->getId() < $b->getId()) ? -1 : 1;
  }
91183
public static function compare(Version $a, Version $b)
    {
        $aValues = $a->numeric();
        $bValues = $b->numeric();

        foreach (array_keys(self::$ordinality) as $key) {
            $aVal = $aValues[$key];
            $bVal = $bValues[$key];

            if ($aVal < $bVal) {
                return -1;
            } elseif ($aVal > $bVal) {
                return 1;
            }
        }
        return 0;
    }
893651
public function compare($a, $b)
    {
        if ($this->collator instanceof \Collator) {
            return $this->collator->compare($a, $b);
        } else {
            return $a == $b ? 0 : ($a > $b ? 1 : -1);
        }
    }
1296053
public function sortQueue($a, $b)
    {
        $buildTimeA = $a->getNextBuildTime();
        $buildTimeB = $b->getNextBuildTime();

        if ($buildTimeA == $buildTimeB) {
            return 0;
        }

        return $buildTimeA < $buildTimeB ? -1 : 1;
    }