src/Collection/ImmArray.php
public function sortHeap(SplHeap $heap)
    {
        foreach ($this as $item) {
            $heap->insert($item);
        }
        return static::fromItems($heap);
    }
public function sortHeap(SplHeap $heap)
    {
        foreach ($this as $item) {
            $heap->insert($item);
        }
        return static::fromItems($heap);
    }
public function sortHeap ( SplHeap $ heap ) { foreach ( $ this as $ item ) { $ heap -> insert ( $ item ) ; } return static :: fromItems ( $ heap ) ; }
Sort a new ImmArray by filtering through a heap.
Tends to run much faster than array or merge sorts, since you're only
sorting the pointers, and the sort function is running in a highly
optimized space.

@param SplHeap $heap The heap to run for sorting
@return static
Sort a new ImmArray by filtering through a heap . Tends to run much faster than array or merge sorts since you re only sorting the pointers and the sort function is running in a highly optimized space .