[PR][php-src][#1116][master] - Sortable interface
| From: | noreply@php.net | Date: | Tue, 24 Feb 2015 09:20:43 +0000 |
| Subject: | [PR][php-src][#1116][master] - Sortable interface | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-2473@lists.php.net to get a copy of this message | ||
You can view the Pull Request on github:
https://github.com/php/php-src/pull/1116
Pull Request Description:
This implements a new interface Sortable.
Works with *sort() functions.
Could be quite powerful when combined with Comparable (https://github.com/php/php-src/pull/1097)
```
/** @ingroup SPL
* @brief This Interface allows to hook into the global sort() functions.
* @since PHP 5.6
*/
interface Sortable
{
/** Sort the entries by values.
*/
function sort($sort_flags = SORT_REGULAR);
/** Sort the entries by values in reverse
*/
function rsort($sort_flags = SORT_REGULAR);
/** Sort the entries by values and maintain indexes.
*/
function asort($sort_flags = SORT_REGULAR);
/** Sort the entries by values in reverse and maintain indexes.
*/
function arsort($sort_flags = SORT_REGULAR);
/** Sort the entries by key.
*/
function ksort($sort_flags = SORT_REGULAR);
/** Sort the entries by key in reverse.
*/
function krsort($sort_flags = SORT_REGULAR);
/** Sort the entries by values using user defined function.
*/
function usort(mixed cmp_function);
/** Sort the entries by values using user defined function and maintain index.
*/
function uasort(mixed cmp_function);
/** Sort the entries by key using user defined function.
*/
function uksort(mixed cmp_function);
/** Sort the entries by values using "natural order" algorithm.
*/
function natsort();
/** Sort the entries by values using case insensitive "natural order" algorithm.
*/
function natcasesort();
}
```
# Requesting a pull to php:master from php:sortable-interface
#
# Write a message for this pull request. The first block
# of text is the title and the rest is description.