Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125815 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 9CCF81A00BD for ; Sun, 20 Oct 2024 21:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1729460532; bh=j0ktRR2dug4FBaLJjLf4o1nYVSGEdXJAEh7U9RlrK3I=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Oleza3xrZ7XiIf4EGBdW4qjmhbBm8H1A//Mc81RHVuLUbEJOb+IpvVDYONLbOknRw lXeN8f1gMCOzOXf1nK+HCbpxasHpl7mcIy9l7fz5IQmFKxlqoFcIVrWU1sk2DCYZbR jaYYxSxCD3YXpFhUCnZRN32yzUuxeH712hu3LfH9RCwjwM0W9lAh+RoG36ukMpDYnz tPh+Tbp6kxixCWcj0tU17hjeEvJmga1yxPE4rbL6gtf/68T+nWycvIXtSd6yvveOZE 3VgLr4uVze1Xby7rwr6RCO302EFZdPKN9fKUB2oG2S4R5N4GpbpB9arejeRd1Y8rxB 0IkC6lKWBTAug== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 29C8C18004F for ; Sun, 20 Oct 2024 21:42:12 +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.8 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2090.outbound.protection.outlook.com [40.92.91.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 20 Oct 2024 21:42:11 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IVGFMPncYKF27ERwG3h0+RxwKGCUYjiul36j1wJT2IhzBUDcGgqRbBGaUG997uDGoe7bKzWeyub90MzCpKCSg90GCPufeOicHU9012ocElqTXiLobZkO4CPkFveOr1ptD7Yv+5FPZDGoZEj1jm6s59KR0KX+Bq2RPqi+RhM9M5rA8kCh+Cy9nGkiw8jRWz20CiuNm5ms4ittDxZ0YPsI9gJ+e/mGvD56gmBYBuZhkouoWT7KQpqrqnPYvr1K2Rkxmeu28KceCu8ACztgPtlRsS2uX/WqgmdxIarN65qzrfJ98qtrIDb7ttZQWTQlmS5Y3ZvfD+DOlQByauA+Ax7PxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zC4vtFQqUT+sI+GFB0hodjYDBwxv7RESb0gYC8M2qSw=; b=qp76jc2J5BZNu6qc+gd3MoOwWCD6/tRmp57LHnNO5RJ3el6hAM2xLYyhhDbnPn3dGjlujsMz6h8jlhtwt9LyF0ziNtex3g84YubWPuW75YVgw4RbiK8Ygl5zaC/J+JdDuejH5nQ2dzViACxCk7A92uCtpYMvPkiU80bMKNEaB6LIxZv9c2xOWmoOyuj7URu+5TfmV/qhRIpRTGg8AcHnsN803y+Zz7iFYfZePeFEEmSgoaNkRPbxWrRNKDcKMkU0bPqRAEZ2EKHG8rFIDIz035oEU16D8al3933ps20IjFDyxkzsIAzPfzkVtF/xs7Uuac1yL6SxMyLONOfrHTi02Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zC4vtFQqUT+sI+GFB0hodjYDBwxv7RESb0gYC8M2qSw=; b=M7pok+2MKyyhJCzGhtvnJTiE58IS060uPEo14tKh4atrFdx0e+Fm/LzAwBEdNDasirXZue95kx7l/5fGKtT/QmLPVRguXbNJorMl0EUhim4Nx7cx/iPeXvYrqLaZZplQah2zDk8pmU9+7M7jD0FbVn4tYLn6wuGQVqpF72NPQ5kD3ltiYLu/ehcxdumntmIGPjeQJfStgHP5TiO0SIzZsZppqp9TRkCUdtabxr/+PH0ukYubuD/0Juj0hNl5koErSziHANhA0KhhQMgqTAtEOQTCt3pVyYZJFJqyLJxx9WkCf+DDgJq11EekTuBohfssAUyHJMGB7xd8pmNdGFLHIQ== Received: from AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) by PR3P250MB0385.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Sun, 20 Oct 2024 21:39:45 +0000 Received: from AM8P250MB0170.EURP250.PROD.OUTLOOK.COM ([fe80::651e:bbd2:b18a:80ff]) by AM8P250MB0170.EURP250.PROD.OUTLOOK.COM ([fe80::651e:bbd2:b18a:80ff%4]) with mapi id 15.20.8069.027; Sun, 20 Oct 2024 21:39:45 +0000 Message-ID: Date: Sun, 20 Oct 2024 23:39:44 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] Change behaviour of array sort functions to return a copy of the sorted array To: Ilija Tovilo , php internals References: <20340e0e-ddd0-44cd-b555-1402857eb20f@app.fastmail.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: FR2P281CA0143.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:98::16) To AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) X-Microsoft-Original-Message-ID: <1b8ca27d-a9e0-4f5d-8b7f-5a47745a5df9@hotmail.com> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8P250MB0170:EE_|PR3P250MB0385:EE_ X-MS-Office365-Filtering-Correlation-Id: c37c43f0-9455-4d73-4a76-08dcf14fb6dd X-Microsoft-Antispam: BCL:0;ARA:14566002|8060799006|19110799003|6090799003|461199028|5072599009|15080799006|7092599003|3412199025|440099028; X-Microsoft-Antispam-Message-Info: ud6Dl5xQBZqrJQNlAqiZiHMmqrir2/T+aofdg1ALOpDoJfl2Cw5f9q/hij7MePD9izukiNQom1eoqWWpif3f52UYAxVSyFzGKpiyNeXGOCzFTYLZ4afd9/yxZSUr6XZ71ztgAas1U14fkBCIy534MN5jTDY0454H+7b4pPoORG10zzWz4LAeP59pD2zi5hDvoYiHWJy5F8fb6giVXjv3I35qZhoWmoecEnfGy567mTb9q5alHPkjY0uUZPQi7+DE3rAbDg4ayMfOj6ksU4tEE4QWSHn1t4RFVVmpm51EViUCp5oqB328ojobpIKTaGd01AVbPAVr1lYdQpE0HPpbQgdywCWt0t+QV8/Jcqj0R+TqP5sI8YnPZ2N+Fk7z07QK9CxejimnzZHFGhit/WgD7lZa9RWyoshzFjv87f3QzzpZEaBYFrIopd9KQb+RJ06TxnKTVGMqgntSzBuAXlCy9Ymfqd5eaSUTuNqk25AtpHQ0Y7xUCsOXapxWA9MsRMsT/JhZB4+9Cgrwvfz2n8e3d91M2fL/HRqfQlsfMys6NW2H/pWtwUrQLrgCmCZI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1VXQXJqbUo5SVp6MmR2bW5XWkwyWjV3?= =?utf-8?B?TFFMdmhJNlV6RllXR0c2Qmc1MTNyMlY3SDRsam0waStMMXZBNGszbG1JalV0?= =?utf-8?B?UWYyRVA3Ly82WTdkR015bWxlYjBDK2lLU0hUZjcyTkIrOTU3YVQwTXJRdW1D?= =?utf-8?B?QUFvL05RT2U4Y3hBZ3JJdWMyL1FkV1YxNlpsc3h0c3ZvRlViMWs5T1lFVnNs?= =?utf-8?Q?4MpLi020jQGhUwYiKE=3D?= X-OriginatorOrg: sct-15-20-7784-11-msonline-outlook-95b76.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: c37c43f0-9455-4d73-4a76-08dcf14fb6dd X-MS-Exchange-CrossTenant-AuthSource: AM8P250MB0170.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2024 21:39:45.5771 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3P250MB0385 From: bobwei9@hotmail.com (Bob Weinand) On 20.10.2024 23:23:21, Ilija Tovilo wrote: > Hi Bilge > > On Sun, Oct 20, 2024 at 10:30 PM Bilge wrote: >> I 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 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. Bob