phpstreams\Stream::sorted PHP Method

sorted() public method

This method yields its values sorted. Sort is done using the default asort() function, or uasort if a sorting function was given. Note that by the nature of sorting things, the entire previous source will be read into memory in order to sort it. This may be a performance issue.
public sorted ( callable $sort = null ) : Stream
$sort callable [optional] a callback to use for sorting.
return Stream
    public function sorted(callable $sort = null)
    {
        return new SortedOperation($this, $sort);
    }