Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128573 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 lists.php.net (Postfix) with ESMTPS id 2FB381A00BC for ; Wed, 27 Aug 2025 16:06:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1756310719; bh=whhTCleJPl0XuUjCPgEMaGQMDFwcBhmnEQcMq9E24yw=; h=Date:Subject:To:References:From:In-Reply-To:From; b=fnxYr+fJbwLHjnG5tyIrtfEvnAy5T6Rh05qy2/qtNWqiZErz4qlhuAmyHRhQJcyh+ eykCG2WooNeWsQsq3lOTR0K7iQQbnKr5HDYERU07ZXgc8CMvsSV26oEnSDXSk7g8cv WFtmptYyAuzcz4FtrqxUmw3qfMviZ8LEIKqE66wPAe2z6eXEGntgIfH1h9n6PJBez3 Slxrjdo7M3i/TtDhey3iR5IJUM0E/G8C5wfqYgek91gnDh06P9I/SdOHcqrCtpYghv C2dhYlSkXsqG71J4cWaFxVszu9Z3EDiYW/ojbE0Z9sFXiwEhyGnc07nmLosZCIdaxL jHB9zeYcoHozA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 4B737180061 for ; Wed, 27 Aug 2025 16:05:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_05, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2030.outbound.protection.outlook.com [40.92.50.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 27 Aug 2025 16:05:14 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DwJpuzamLpmY6oAe4vvaVAikaQKut+pPQFPbj5NsSHTYk6vYsqinCN1FPIXmrcsqfH2ZtlTI4cV0vfQvOy7h1D/bake6i8f9CQmgU2/x5DME6ho91p4Qj/0ayrhdLfh/ukyFTlJQtRJrlth4Q4LvZZrS9pxODvA1/mhGPQVv6f6Vcv0nEMprhUW+dP2rEViflo438DScBA4Z+IZLJmwhloO4D0FRaTt/aa1fwZksHxVa3WSK7FQyz289KuJPC+OuSdciI6At3rzWWlteFkwuV9rMopAqLv6KYtRcxM4CUzksX8PKkKIBVGc6dVfK3eZaaDLPUCw77PoB3aOqU1WWmA== 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=SNEdnmN6z51D9eyqrfUWgVZAI7GeQQj2xe2dvG9/7Hw=; b=kBig7+K7GOzMvHfZCzNFRx0xfXv1u/ezIPT1OR0C41SMEkIL6yxgVLogFm+v+pRUiOEeWj/oVh4X+uUzsxUTs+k0NDyfMDcmPbC8aX5KJ1QKY76o/L7/N69LG7bLIXf5OlimT7tuKiDcZyhJ6xtWcLaekTuXkRWHhlzoQfcDqSC3qQ6dRGpp6Ous9ythnNK/jvl3hrZsUknq7X5afOtapi+5Fe4Zgh3jbwYnyWfJDwnbCT8PQyZfgzNJTcTnqm9Z/bvV+WBBIy8wVHx3ubkSZN5E3ml4pupqo36Fb4bqizYIfDtD9CY+uRNZrAFb33IYIewZ1yrD63tRCW8XZ8FtUQ== 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=SNEdnmN6z51D9eyqrfUWgVZAI7GeQQj2xe2dvG9/7Hw=; b=tZ30nKaRneFdXzmDnS4x7WU+nS4kj3s2bNHjDvuFCLgEKb6LLHctuUnlPKNlJso77eY4E9Qh5yQS1d9KmqM2u8OVFLO+mB89pApltuPZ895KJTN3gxXoyFm+N3xmyZEmfdCPtRlQqY1u5sFMj+EeFh4FNt34dezHe1tZn1654owl3jYCzq60gj8SfIUhllGkmbhgRWlT1zvlfneA9prUfV2i8agb9sODqEzBXuGKDj2sbJbWcK3ZS6Yal8wAdSpCIqHfDESGwfuRf8jT1b+DdwgRd2DI8JKDp2JxGxwuMTCFYS0n4iM37kTLmdlcCalUwOiq1DgY7Zi2s5F9ta/pnA== Received: from AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) by AM8P250MB0247.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:32a::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9073.14; Wed, 27 Aug 2025 16:06: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%6]) with mapi id 15.20.9073.010; Wed, 27 Aug 2025 16:06:45 +0000 Content-Type: multipart/alternative; boundary="------------LBYooIns4bLJ4jApmsRO0Cns" Message-ID: Date: Wed, 27 Aug 2025 18:06:44 +0200 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] [RFC] [Discussion] Add clamp function To: Kyle Katarn , PHP Internals References: Content-Language: en-US In-Reply-To: X-ClientProxiedBy: FR5P281CA0037.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:f3::17) To AM8P250MB0170.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:321::21) X-Microsoft-Original-Message-ID: <930fa544-db0a-405c-bfb1-d6128a6a758d@hotmail.com> Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM8P250MB0170:EE_|AM8P250MB0247:EE_ X-MS-Office365-Filtering-Correlation-Id: 4392286d-7d96-409a-dfd8-08dde583b7fc X-Microsoft-Antispam: BCL:0;ARA:14566002|19110799012|8060799015|9400799033|23021999003|12050799012|5072599009|15080799012|461199028|10035399007|4302099013|440099028|40105399003|3412199025|26104999006|1602099012; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OHQxdGlBR1RUZVhIaHc2WjZJQmhZMjMvN3crY3IzUzE1RDVPM2Rid0FEWUVV?= =?utf-8?B?V1h0ZUs4WmlmUTFFbkdqb0dZOXZwb3Rmakp3OXY2S2dPbjRvb1VmV2ZuWit0?= =?utf-8?B?NVpsczFRZU5La3RSeDJub0JPOURONHJidlFCUnloMTU0d0JBK0R0WUVzbVp1?= =?utf-8?B?Y0R6bXBmTmpSeXpvTk12ZkExL0dzeXZXMFc0UExBd3ZVWjkxeExoWk01MmRD?= =?utf-8?B?L29CMzdNa09oUHpwTnhmdHJpT3ZCNnNkRzFianBlVTRzMmtXUGpvNGhYRktH?= =?utf-8?B?U2diS0Z5M2RUU3VCVk9CQ2YxUDIvaDM2UW40amYxY29vRVk5OXdjalVEcUE0?= =?utf-8?B?bTdqTGM5eldXRlJZemdZS3pXTDRTTXJ3dHRScWFuSHM1eFFXTWNhcHJTakRT?= =?utf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Q0pUN3VHdWRMY3o0Wmcz?= =?utf-8?B?OURNOWJqbXdQSFFqUERpemJIVUM2K1JkM2EyWjBFOUp4SjRQNjlWazFCUlBQ?= =?utf-8?B?SzlKV1FlZFVlaHVHcEZ3QXl1d2JoR2ErODB3ZVQ3Vk1xK2FMSVltY3p3N09h?= =?utf-8?B?NUhneVJJYnphQ0g0NEI0VHQrUExHSXY4V2RxcDU1T1c1bHhpdEpWZUZZUFJL?= =?utf-8?B?WjNtdWd6TnJkbFRHRURQU2NpUFVhOXFoY1JZUDNBMjFqYUh6bzhSUFlRdC9I?= =?utf-8?B?MzRZWjdZYUFGbDV0d2p2OTljSnI0Yk8rR2RIaW5UdnpIZlZ0Vm01eGttdmQx?= =?utf-8?B?THFZdm5pSVhOU0czS3R3NjlwRTJFTUZtUHNEY0FJZUowSnZvQWw5RGQxejRX?= =?utf-8?B?SnpwdUFGZnNUL2kvQmRGZGdVcUJwd2ZrVWMydG1aOTlPVGErNHBwNHJ6cTVI?= =?utf-8?B?RTAyK0ttMW5FRUxZQW9xSVNpSGpvR2xVNW9mcWZkN1pRNXY1a3ZTd05jTTVL?= =?utf-8?Q?PbBCIwMsyw6nMcQKac=3D?= X-OriginatorOrg: sct-15-20-8534-15-msonline-outlook-5f066.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 4392286d-7d96-409a-dfd8-08dde583b7fc X-MS-Exchange-CrossTenant-AuthSource: AM8P250MB0170.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2025 16:06:45.1579 (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: AM8P250MB0247 From: bobwei9@hotmail.com (Bob Weinand) --------------LBYooIns4bLJ4jApmsRO0Cns Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hey, On 27.8.2025 15:34:53, Kyle Katarn wrote: > Hello, > > I handled the feedback received on the draft RCF > https://wiki.php.net/rfc/clamp_v2 > > If I didn't forget anything this should be now ready for discussion. > So I updated its status. > > There is an implementation proposal: > https://github.com/php/php-src/pull/19434 > And some draft for documentation here: > https://github.com/php/doc-en/pull/4814 > > Thanks, As others have noted before, what's the motivation of having the to-be-clamped value as first parameter rather than infixed between min and max? E.g. from CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/clamp: |clamp(min, val, max)| Feels to me as the most natural order, too. You mention it was taken from the first RFC, but that one also did not discuss the ordering in the first place either. Bob --------------LBYooIns4bLJ4jApmsRO0Cns Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Hey,

On 27.8.2025 15:34:53, Kyle Katarn wrote:
Hello,

I handled the feedback received on the draft RCF https://wiki.php.net/rfc/clamp_v2

If I didn't forget anything this should be now ready for discussion. So I updated its status.

There is an implementation proposal: https://github.com/php/php-src/pull/19434
And some draft for documentation here: https://github.com/php/doc-en/pull/4814

Thanks,


As others have noted before, what's the motivation of having the to-be-clamped value as first parameter rather than infixed between min and max?

E.g. from CSS: https://developer.mozilla.org/en-US/docs/Web/CSS/clamp:

clamp(min, val, max)

Feels to me as the most natural order, too.


You mention it was taken from the first RFC, but that one also did not discuss the ordering in the first place either.


Bob --------------LBYooIns4bLJ4jApmsRO0Cns--