Skip to content

Commit

Permalink
Fix #1
Browse files Browse the repository at this point in the history
  • Loading branch information
rosstuck committed May 28, 2018
1 parent 9778b66 commit 0904aa2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Tuck\Sort
![Badge](https://travis-ci.org/rosstuck/sort.svg?branch=master)

Syntactic sugar for PHP's built in sorting.

Expand Down Expand Up @@ -195,7 +196,7 @@ $sortChain = Sort::chain()

```

Once you've created your sorting chain, you can apply it to keys or values. Features like Iterator support, returned values, and PRESERVE_KEY flag are all supported are all supported.
Once you've created your sorting chain, you can apply it to keys or values. Features like Iterator support, returned values, and PRESERVE_KEY flag are all supported.

```php
$sortChain->values(['foo', 'bar']);
Expand Down Expand Up @@ -228,12 +229,6 @@ if ($options['sort_by_name']) {

However, if use the chain before any sorts are added, then the order is essentially random and decided by your PHP runtime (PHP 5.x vs PHP 7 vs HHVM). There's no easy way to normalize this (I've tried) but it varies based on the runtime, the number of elements in the array, the sorting algorithm used, etc. The good news is it doesn't matter if the elements are random because there was nothing worth sorting by anyways! :)

## Roadmap

- Need to investigate supporting native sort flags
- Could add support for the "reverse" sorting functions to get some minor speedgains.
- Standard functions instead of namespaced ones could be nice, will probably wait for function autoloading

## License

[MIT](https://opensource.org/licenses/MIT)
Expand Down

0 comments on commit 0904aa2

Please sign in to comment.