The Ds\Sequence::sorted() function is an inbuilt function in PHP which is used to return the sorted copy of sequence element.
Ds\Sequence abstract public Ds\Sequence::sorted( $comparator )
Parameters: This function accepts a single parameter $comparator which holds the comparison function. The comparison function returns an integer value which is less then or greater then or equal to zero.
Return value: This function returns the sorted copy of sequence.
Below programs illustrate the Ds\Sequence::sorted() function in PHP:
Ds\Vector Object (  => 1  => 2  => 4  => 5  => 6  => 9  => 9  => 12 )
Ds\Vector Object (  => Abc  => GFG  => Geeks  => for )