Re: [RFC] Change behaviour of array sort functions to return a copy of the sorted array
| From: | Christoph M. Becker | Date: | Wed, 30 Oct 2024 12:41:57 +0000 |
| Subject: | Re: [RFC] Change behaviour of array sort functions to return a copy of the sorted array | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125881@lists.php.net to get a copy of this message | ||
On 20.10.2024 at 19:42, Gina P. Banyard wrote:
> I would like to propose a short RFC to make the return value of the sort() and similar
> functions more useful:
> https://wiki.php.net/rfc/array-sort-return-array
After having thought a bit about
<https://github.com/php/php-src/issues/16648>,
I don't think it makes
much sense to stick a band-aid on our sorting functions to make them
more functional. Instead we should better introduce proper functional
functions which do not modify the given array. Less efficient, but that
often may not matter in practise.
Christoph