Re: [RFC] Change behaviour of array sort functions to return a copy of the sorted array
| From: | Bob Weinand | Date: | Sun, 20 Oct 2024 21:39:44 +0000 |
| Subject: | Re: [RFC] Change behaviour of array sort functions to return a copy of the sorted array | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-125815@lists.php.net to get a copy of this message | ||
On 20.10.2024 23:23:21, Ilija Tovilo wrote:
Hi Bilge On Sun, Oct 20, 2024 at 10:30 PM Bilge <bilge@scriptfusion.com> wrote:Hey Ilija, yes, I agree it's intuitive. However, I consider it bad to add extra functions for this behaviour. There's very little gain in extra functions, sort(), sorted(), shuffle(), shuffled(), etc.. So yeah, I'd agree on the naming *if* these were the only variation of sorting/shuffling etc. functions. But that's not the case here. I, for my part, very much like the RFC, for that it gives functionality, which I've been missing quite some times already and is minimally invasive. BobI fail to see the logic of present tense = mutate, past tense = copy. At least there is a pattern to it, but I would have to look it up several times before it sunk in since it is not intuitive at all.It's sorted, the adjective. As in, "give me a _sorted_ array", compared to "_sort_ this array". It's a common convention and I always found it intuitive. Ilija