Skip to content

Conversation

@gielfeldt
Copy link

This implements a new interface Sortable.

Works with *sort() functions.

Could be quite powerful when combined with Comparable (#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.

@smalyshev smalyshev added the RFC label Mar 9, 2015
@krakjoe
Copy link
Member

krakjoe commented Jan 7, 2017

@gielfeldt this has merge conflicts, and I cannot find the RFC.

Please can we get an update on the status of this work ?

If you consider this work abandoned, please close this PR yourself.

@krakjoe
Copy link
Member

krakjoe commented Feb 22, 2017

Having waited more than a month for feedback, and having received nothing, I'm closing this PR as it would appear abandoned.

@krakjoe krakjoe closed this Feb 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants