Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128525 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 7BB601A00BC for ; Fri, 22 Aug 2025 11:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1755862142; bh=rwoT4GfFmf8dz5qSr1gKEhVqW9t+/s0Zy6nO+luw/4k=; h=From:To:Cc:References:In-Reply-To:Subject:Date:From; b=jRggZTWdgennNECh8B70p3S+bc82vqysuXvx2I1yC/nyHe70RFkyKFCtQEO9KSH0m c7e48L3OACeqVf8v2xnDD2DSqthxVEoycbVxJebXhmKSIzmW6Np/463SzkqT5y374L ocM00gtGR921kkce46jwjRKDNUrhzj/cdFgS5tQmn7KW/28jnpy3VOC0XR4UM6u9JZ OILOQAZA6QJtJpIiwgAJWeeRmQC6jvcX3t2J773Xp/Hn4A7I8lR6akzrEgbp0Hr1cQ acRcYLy+h8sQOmFJhzqiWuXumO4OT+wn02lNr76VtzIHLiXv3GT6ME71526si0Cr0p YDj8yYORDfVJw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C414D18005D for ; Fri, 22 Aug 2025 11:29:00 +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=1.6 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_50, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING, HTML_MESSAGE,PDS_PRO_TLD,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from beige.elm.relay.mailchannels.net (beige.elm.relay.mailchannels.net [23.83.212.16]) (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 ; Fri, 22 Aug 2025 11:28:59 +0000 (UTC) X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 5EBDC23342; Fri, 22 Aug 2025 11:30:32 +0000 (UTC) Received: from server52.areait.lv (100-96-44-94.trex-nlb.outbound.svc.cluster.local [100.96.44.94]) (Authenticated sender: yszpovajlk) by relay.mailchannels.net (Postfix) with ESMTPA id 1F44D24090; Fri, 22 Aug 2025 11:30:30 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1755862231; a=rsa-sha256; cv=none; b=prgVMfZFB8SgE7feH4UrfiiyGhYYQNv7XVx9bpcOA7gAwJPHo1655NpQ4uoTmR9vFm4l2l qebWCiVkS4LNDWYjNoiw/PkTQx4TGnFFQFcdM6lQeskqcibMljjzuGzihD6Ee50ObHN/sG iEBUWABPXEueIkCxbdRi3ACLsdvCDk8PYCPu5PXk3430zCmnmyxX0x75+Zm0LD23BOc1Gz Ki6KBP/uD0dva+25mvA+jfmcyCO86NJvrdUIqvubMq9Hu0llgzk8qXnmCme3HjmIKggyU8 WDwLN+QBpYhQ0n9mrEG5eBnBsVxO+qa9Mzzn9aCnMhoebqRTsWjSKgncuS7dgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1755862231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pn2I+Qvv7KsCSb4OKz84CsTG1bUBoNBCcxj5QRxjASY=; b=qk9R7BVihcm0dsbBiiEH2uchyyw2Q3wIWWJw+X2epiO+HCCyPXWcgtxCdMq54yuiDqFY4q /sfwD8Hw6Ho6TJ+muo7VR8MrBbavOzUjW0EITT09TOYBUaYcFwjgJhJiCj4tn+eRKQu4IV hkNPp3olNOinpb7sD2hFcoWNJGEtQx0+lzJYsbNWO6I9t6+G0fjeqCSOlNO6SjvBk08UqF Flicimlv0Ks1cx4NvDQ+lcq41hZSwS2wjL3xtnUH+AUKqIqyFeYbmIldUWX30kVE3A11rv z1fZd60zEeSboLEK2F7p2CjQZsOfGXK7GunzEJGdmYdBkKt/T9Aom8xQNnvS3g== ARC-Authentication-Results: i=1; rspamd-6b4c98bb9b-rzflp; auth=pass smtp.auth=yszpovajlk smtp.mailfrom=juris@glaive.pro X-Sender-Id: yszpovajlk|x-authuser|juris@glaive.pro X-MC-Relay: Neutral X-MailChannels-SenderId: yszpovajlk|x-authuser|juris@glaive.pro X-MailChannels-Auth-Id: yszpovajlk X-Eight-Descriptive: 3fe92ba32387cc2f_1755862231821_89081594 X-MC-Loop-Signature: 1755862231821:1725712493 X-MC-Ingress-Time: 1755862231821 Received: from server52.areait.lv (server52.areait.lv [83.149.95.205]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.96.44.94 (trex/7.1.3); Fri, 22 Aug 2025 11:30:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=glaive.pro; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:In-Reply-To: References:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=psQnx2uMid3ecTphJjWJiHYifwGs7ICiasd0x1vWa5M=; b=N9BBYGUHYMtpnAMdvshPHC/JvZ ajXzqfGwj3J3QP0icS3xpaxs3eoo3Bl9wLZ0Q35tx2gOq1XOI1ke1y+rW1oCPuLF+IU92NcZVTGwE PBZULPcaJ2itCnthjkAEyGamoB4e1o0FSK1Gx08aiqlzTTvC1xXvIQkUuMOdvf/NPQI6NuCTuhhop 8OrOErYzqzbDcHLTeo4Q1EdHQ6QMZ9Yv4oT26l9OdeKDEVIj0lWuC49XjU1rmkqAsc7Vm3h245fXA RSjGF2PqanCQqugnUNjoqWGYhX+1TlYvNd13mV2YB6dx9XiP5NrVazcI2IYbZKy+kI4jpSMcyJyQi fAc0Aung==; Received: from [77.93.29.116] (port=57066 helo=LAPTOPHKIOPCGI) by server52.areait.lv with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1upPyb-0000000FXo8-2hGM; Fri, 22 Aug 2025 14:30:29 +0300 To: "'Kyle Katarn'" Cc: "'PHP Internals'" References: <0027ab13-89fb-40b4-991b-2f88a35c2f31@gmx.de> In-Reply-To: Subject: RE: [PHP-DEV] [RFC] Add clamp function Date: Fri, 22 Aug 2025 14:30:26 +0300 Message-ID: <011001dc1358$287f1860$797d4920$@glaive.pro> Precedence: list list-help: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0111_01DC1371.4DCCECA0" X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQG1PUprYudkV0Eijxb+LloO9HXltAEvDpDqAmRpg2QCqmlOiAJoFF9UtHcE7fA= Content-Language: lv X-AuthUser: juris@glaive.pro From: juris@glaive.pro ("Juris Evertovskis") This is a multipart message in MIME format. ------=_NextPart_000_0111_01DC1371.4DCCECA0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Kyle Katarn =20 Sent: Friday, August 22, 2025 11:02 AM To: Christoph M. Becker Cc: Tim D=C3=BCsterhus ; PHP Internals = Subject: Re: [PHP-DEV] [RFC] Add clamp function > I created https://wiki.php.net/rfc/clamp_v2 (re-using most of the info = from https://wiki.php.net/rfc/clamp). Hey, =20 I=E2=80=99m not against adding such a function, but I noticed that the = RFC says =20 > some of which use min = and max to check the = bound, which is costly and slow when called often =20 What makes them slow? If we can create a significantly faster `clamp`, = can we use the same optimizations to improve min and max? =20 BR, Juris ------=_NextPart_000_0111_01DC1371.4DCCECA0 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable

From:<= /b> = Kyle Katarn <kylekatarnls@gmail.com>
Sent: Friday, = August 22, 2025 11:02 AM
To: Christoph M. Becker = <cmbecker69@gmx.de>
Cc: Tim D=C3=BCsterhus = <tim@bastelstu.be>; PHP Internals = <internals@lists.php.net>
Subject: Re: [PHP-DEV] [RFC] = Add clamp function


> I created https://wiki.php.net/rfc/clamp_v2 (re-using most = of the info from https://wiki.php.net/rfc/clamp).

Hey,

 

I=E2=80=99m not = against adding such a function, but I noticed that the RFC = says

 

> some of which = use min and=  max to = check the bound, which is costly and slow when called = often

 

What makes them slow? = If we can create a significantly faster `clamp`, can we use the same = optimizations to improve min and max?

 

BR,

Juris

= ------=_NextPart_000_0111_01DC1371.4DCCECA0--