AbstractCollection::sort

The sort() method sorts the elements in the collection based on the provided callback function.

Description

public AbstractCollection::sort(callable $callback): static

Parameters

callback

A callable function used to compare and sort the elements of the collection.

Return Value

Returns the current instance (static), allowing for method chaining after sorting.

Exceptions

None

Source Code
If you find this project useful, consider leaving a on GitHub! Thank you!