Re: [RFC] Change behaviour of array sort functions to return a copy of the sorted array

From: Date: Sun, 20 Oct 2024 17:49:28 +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-125810@lists.php.net to get a copy of this message
On Sun, Oct 20, 2024, at 19:42, Gina P. Banyard wrote: > Hello internals, > > 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 > > I intend for the discussion to last 2 weeks and then open the vote. > > Best regards, > > Gina P. Banyard > Hey Gina, Just to make sure I understand (the RFC isn't 100% clear on this), but this is still an in-place modification, just returning it as well. Such that $copy = sort($original); assert($copy === $original); ?? — Rob

« previous php.internals (#125810) next »