The Ds\Sequence::sort() function is an inbuilt function in PHP which is used to sort the sequence element in the same place.
void abstract public Ds\Sequence::sort ([ callable $comparator ] )
Parameters: This function accepts a single parameter $comparator which is used to hold the comparison function. The comparison function returns an integer value less then, greater then or equal to zero.
Return value: This function does not returns any values.
Below programs illustrate the Ds\Sequence::sort() function in PHP:
Ds\Vector Object (  => 1  => 2  => 4  => 5  => 6  => 9  => 9  => 12 )
Ds\Vector Object (  => 12  => 9  => 9  => 6  => 5  => 4  => 2  => 1 )
- PHP Ds\Set sort() Function
- p5.js | sort() function
- PHP | sort() Function
- PHP | Ds\Map sort() Function
- PHP | Ds\Deque sort() Function
- PHP | Ds\Vector sort() Function
- p5.js | Bubble Sort
- p5.js | Quick Sort
- Sort an array of dates in PHP
- How to sort a list alphabetically using jQuery ?
- Sort array of objects by object fields in PHP
- Sort a multidimensional array by date element in PHP
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.