Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125810 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 590ED1A00BD for ; Sun, 20 Oct 2024 17:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1729446734; bh=Qt0WiPfiZiIhgLSB/eJ1aAKm4pNd5iflGoRtvpaiFDE=; h=Date:From:To:In-Reply-To:References:Subject:From; b=oJcVVKfRtAkTEv21aI/9ZGENGm50ieU4kRU/5SJzlYVggpFRBgfXSkVN6b7ewAMcJ vo6buU6u9rGa/9BH7oTlhgOiO+n6KC8VWkoe3mvtUHQQpFRivbdc/hdLTINPStTKBX E+gyuE+2VuDOLDzLVkQNQWEJiSCI1ywmYk93VsLG46/2MjgDF1UAg47daKvlkv8cln OVj8Vp0l1Bpnr/+CcuQDEctPqIgLkp7QdPEgC9ZSJHfLf/JbtTWAlI36pmeBqI4KGm YWLinDfhyUAkErWaleJq0pCxjB6EoKhhOvWq7Q91RBuxzUeC79JefRePBuoZAnpApH YsmY7xd0yPsww== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9939F18003F for ; Sun, 20 Oct 2024 17:52:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fout-a7-smtp.messagingengine.com (fout-a7-smtp.messagingengine.com [103.168.172.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 20 Oct 2024 17:52:13 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 7CBE813801D9 for ; Sun, 20 Oct 2024 13:49:49 -0400 (EDT) Received: from phl-imap-09 ([10.202.2.99]) by phl-compute-01.internal (MEProxy); Sun, 20 Oct 2024 13:49:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1729446589; x=1729532989; bh=Qt0WiPfiZi IhgLSB/eJ1aAKm4pNd5iflGoRtvpaiFDE=; b=omdq9OVT0Y7vKf/WOxtUNBdcAp hzDjaeQ+HKY19PQxE8BO/5iSpJoHT1kmNNqvhFFIvi/15c1+CGhRKlhyGqTkzCc8 BOqKfabCBSVfD0Gzj4Pb/D6U/aXsETjCux7gR4Uqo3qdZcs87YQudzpnB5umFb79 ELe+Tjkc9HSRNQHSImwxr69Sv9SIjOkz3B86MNLqv/wFl1UC+iTHF0+92RaWDpA+ GLns5bAT3l8YOa8P20BbyxcQyZNqaVnLJliE1eJ06ZDqVxf2uVs9v4f/Mb9/UWYk 1Nv60ZQjOXGf+8BHnMdkLm4eoiLKXNrE4AZh9xPimumna/sAQKGaRY433fhQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1729446589; x=1729532989; bh=Qt0WiPfiZiIhgLSB/eJ1aAKm4pNd 5iflGoRtvpaiFDE=; b=JYi4J14aEdgxZzZowOBVE5relMHCCGOb7IXjWlT1YWWL V2spJCPkzcK/Dj5sCdcOa7JPfZE3c8EgTE/OoQ3JswP1JY3L7QxpzMaSRpjv/g9q We7PvwjGuHO0TC4ZX6I9qvtFu+LG7LebRuRT0/2sLcIhYkBDmabFHjel6A6wnQiX /PcPG6ptdG1AJizqp5vQy8lIpsi5cscp+FWLRq0dLz9HiFahqbpa2ceyNr4vTrus LfhLS1fEfNk5+SxT4V5KJoRCMa06khnnttEEDbD3XcFwfKdQUb1BJMDeCfso7iQh +a1t4eP+AlA5rpEr/MZSGedGpVQPI69Zad2Cyld/YA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdehjedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepofggff fhvffkjghfufgtsegrtderreertdejnecuhfhrohhmpedftfhosgcunfgrnhguvghrshdf uceorhhosgessghothhtlhgvugdrtghouggvsheqnecuggftrfgrthhtvghrnhepleekhe dtgfefhfelieelgfegiefhkedvleefjedtffelhfehheffgfduteduuddtnecuffhomhgr ihhnpehphhhprdhnvghtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprhhosgessghothhtlhgvugdrtghouggvshdpnhgspghrtghpthhtohep uddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepihhnthgvrhhnrghlsheslhhish htshdrphhhphdrnhgvth X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 18029780068; Sun, 20 Oct 2024 13:49:49 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Sun, 20 Oct 2024 19:49:28 +0200 To: internals@lists.php.net Message-ID: <9f0b9bf2-ffee-4566-81a5-95e84d5da928@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array Content-Type: multipart/alternative; boundary=0ad4af9fb6ec4b61bb67096ddeffce09 From: rob@bottled.codes ("Rob Landers") --0ad4af9fb6ec4b61bb67096ddeffce09 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, Oct 20, 2024, at 19:42, Gina P. Banyard wrote: > Hello internals, >=20 > I would like to propose a short RFC to make the return value of the so= rt() and similar functions more useful: > https://wiki.php.net/rfc/array-sort-return-array >=20 > I intend for the discussion to last 2 weeks and then open the vote. >=20 > Best regards, >=20 > Gina P. Banyard >=20 Hey Gina, Just to make sure I understand (the RFC isn't 100% clear on this), but t= his is still an in-place modification, just returning it as well. Such t= hat $copy =3D sort($original); assert($copy =3D=3D=3D $original); ?? =E2=80=94 Rob --0ad4af9fb6ec4b61bb67096ddeffce09 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
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 s= ort() and similar functions more useful:

I intend for the d= iscussion 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% cle= ar on this), but this is still an in-place modification, just returning = it as well. Such that

$copy =3D sort($origi= nal);
assert($copy =3D=3D=3D $original);

??

=E2=80=94 Rob
--0ad4af9fb6ec4b61bb67096ddeffce09--