diff --git a/src/Illuminate/Support/Collection.php b/src/Illuminate/Support/Collection.php index 6d550d363632..63acd685839b 100644 --- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -947,13 +947,9 @@ public function sort(callable $callback = null) { $items = $this->items; - $callback ? uasort($items, $callback) : uasort($items, function ($a, $b) { - if ($a == $b) { - return 0; - } - - return ($a < $b) ? -1 : 1; - }); + $callback + ? uasort($items, $callback) + : asort($items); return new static($items); }