src/Data/DefaultCollection.php
public function sort($callback)
    {
        $newCollection = clone $this;
        \uasort($newCollection->arrCollection, $callback);

        $newCollection->arrCollection = \array_values($newCollection->arrCollection);

        return $newCollection;
    }
public function sort($callback)
    {
        $newCollection = clone $this;
        \uasort($newCollection->arrCollection, $callback);

        $newCollection->arrCollection = \array_values($newCollection->arrCollection);

        return $newCollection;
    }
public function sort ( $ callback ) { $ newCollection = clone $ this ; \ uasort ( $ newCollection -> arrCollection , $ callback ) ; $ newCollection -> arrCollection = \ array_values ( $ newCollection -> arrCollection ) ; return $ newCollection ; }
Sort the records with the given callback and return the new sorted collection.

@param callback $callback The callback function to use.

@return CollectionInterface
Sort the records with the given callback and return the new sorted collection .