Sorts this list, optionally by a user defined compare function
@param \Closure $compare
@return \Cola\ArrayList
@throws ReadOnlyException
194676
public function sort(\Closure $compare = null){
		
		if($this->_ReadOnly){
			throw new ReadOnlyException(\get_called_class() . ' is read only');
		}
		
		if(\is_callable($compare)){
			\usort($this->_Arr, $compare);
		}
		else{
			\sort($this->_Arr);
		}
		
		return $this;
		
	}
1151611
public function layout($compare = null)
    {
        if ($compare === null) {
            return $this->layoutName;
        }

        return $compare === $this->layoutName;
    }
472673
public function compare($strict = false)
    {
        return CompareHelper::compare($this->compare1, $this->operator, $this->compare2, $strict);
    }
1256535
public function sort(Closure $callback = null)
    {
        if ($callback) {
            usort($this->items, $callback);
        } else {
            sort($this->items);
        }
        return new static($this->items);
    }
1198220
final public function compare($item1, $item2)
    {
        if (!$this->isReady()) {
            throw new \RuntimeException("The comparer is not ready, no valid callback has been set.");
        }

        return call_user_func_array($this->callback, [$item1, $item2, $this->options]);
    }
739678
public static function compare()
    {
        $args = func_get_args();

        $operator = array_shift($args);

        return call_user_func_array(self::getComparator($operator), $args);
    }
966571
public function compare($compare, callable $callback = null) {
		if ($callback === null) {
			$callback = 'strcmp';
		}
		return $callback($this->string, (string) $compare);
	}
524344
public function sort(callable $callback = null)
    {
        $items = $this->getArrayCopy();
        $callback ? uasort($items, $callback) : asort($items);
        return new static($items);
    }
53992
public function setCallback(Closure $callback = null)
    {
        if ($this->callback !== null || $callback === null) {
            throw new \RuntimeException("Cannot redeclare this comparer callback.");
        }

        $this->callback = Closure::bind($callback, $this, get_called_class());
    }
1162205
function sort(comparefn) {
    return comparefn === undefined
      ? $sort.call(toObject(this))
      : $sort.call(toObject(this), aFunction(comparefn));
  }
1062862
public function sort(ComparatorInterface $comparator = null)
    {
        if (null === $comparator) {
            $comparator = $this->comparator;
        }
        $elements = $this->toArray();
        uasort($elements, $comparator);
        return new static($elements, $this->getResolver(), $comparator);
    }
577481
function sort(array, compare) {
  for (var i = 1; i < array.length; i++) {
    var item = array[i];
    var indexHole = i;
    while (indexHole > 0 && compare(array[indexHole - 1], item) > 0) {
      array[indexHole] = array[--indexHole];
    }
    array[indexHole] = item;
    if (sortExternal.shiftObserver) {
      sortExternal.shiftObserver(i, indexHole);
    }
  }

  return array;
}
304223
function sortCustomKey(callable $closure) {
        $data = $this->data;
        \uksort($data, $closure);
        
        return (new self($data));
    }
801173
public function sortOn(callable $fn, $order = Sort\ASC)
    {
        $this->items = Sort\comparison($this->items, $fn, $order);

        return $this;
    }
810415
public function sorted(callable $comparator = null): Map
    {
        $copy = $this->copy();
        $copy->sort($comparator);
        return $copy;
    }
1133671
public function sort(?callable $comparator = null): SetInterface
    {
        $comparator ?
            $this->items->sort($comparator) :
            $this->items->sort();

        return $this;
    }
1202884
public function sort($callback = null)
    {
        if (is_callable($callback)) {
            usort($this->attributes, $callback);
        } else {
            sort($this->attributes);
        }

        return $this;
    }