Comparative function
| name | income |
|---|---|
| John | $50,000 |
| Marry | $60,000 |
| Peter | $100,000 |
| Donald | $80,000 |
->pipe(new Sort(array(
"income"=>function($a, $b) {
if ($a < $b) return 1;
else if ($a === $b) return 0;
else if ($a > $b) return -1;
}
)))
| name | income |
|---|---|
| Peter | $100,000 |
| Donald | $80,000 |
| Marry | $60,000 |
| John | $50,000 |