[PHP-DEV] Re: [RFC] [Discussion] Add clamp function

2025-09-21 Thread Kyle Katarn
Hi, 2025-08-27 at 15:34, 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

Re: [PHP-DEV] [RFC] [Discussion] Add clamp function

2025-09-19 Thread Kyle Katarn
Hello 2025-08-29 at 15:12, Tim Düsterhus wrote: > Hi > > On 8/29/25 04:42, Morgan wrote: > > Another part of the argument is "complexity", as brought up in the > > original proposal. I notice that the offered implementation of this > > function relies entirely on zend_compare(). > > I'm not find

Re: [PHP-DEV] [RFC] [Discussion] Add clamp function

2025-08-28 Thread Kyle Katarn
Hi, 2025-08-28 at 09:37, Tim Düsterhus wrote : > Hi > > Am 2025-08-28 08:35, schrieb Hans Krentel: > > This also highlights a minor but important clarification for the > > documentation. To make the behavior perfectly unambiguous, I suggest > > a small edit to explicitly state the bounds are inc

[PHP-DEV] [RFC] [Discussion] Add clamp function

2025-08-27 Thread Kyle Katarn
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

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-24 Thread Kyle Katarn
2025-08-23 at 12:06, Rob Landers wrote: > > On Fri, Aug 22, 2025, at 22:09, Larry Garfield wrote: > > On Fri, Aug 22, 2025, at 12:45 PM, Kyle Katarn wrote: > > > About "What determines comparability", it follows the usual rules of > &g

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-24 Thread Kyle Katarn
2025-08-22 at 22:29, Morgan wrote: > On 2025-08-23 05:29, Kyle Katarn wrote: > > > > Also from my point of view, min($max, max($min, $value)) has a counter- > > intuitive reading when used to clamp a value. > > Well, that's trivial to deal with: > > min(

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-22 Thread Kyle Katarn
2025-08-22 at 18:09, Larry Garfield wrote: > On Fri, Aug 22, 2025, at 3:01 AM, Kyle Katarn wrote: > > 2025-08-20 at 14:28, Christoph M. Becker wrote : > >> On 20.08.2025 at 09:29, Kyle Katarn wrote: > >> > >> > 2025-08-19 14:59, Tim Düsterhus wrote :&g

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-22 Thread Kyle Katarn
2025-08-22 at 13:30, Juris Evertovskis wrote: > *From:* Kyle Katarn > *Sent:* Friday, August 22, 2025 11:02 AM > *To:* Christoph M. Becker > *Cc:* Tim Düsterhus ; PHP Internals < > internals@lists.php.net> > *Subject:* Re: [PHP-DEV] [RFC] Add clamp function > > &g

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-22 Thread Kyle Katarn
2025-08-20 at 14:28, Christoph M. Becker wrote : > On 20.08.2025 at 09:29, Kyle Katarn wrote: > > > 2025-08-19 14:59, Tim Düsterhus wrote :>>> > > https://wiki.php.net/rfc/howto#external_resources#rfcs_belong_to_a_single_author > >> (the "RFCs 'belo

Re: [PHP-DEV] [RFC] Add clamp function

2025-08-20 Thread Kyle Katarn
Hi 2025-08-19 14:59, Tim Düsterhus wrote : > Hi > > Am 2025-08-19 09:32, schrieb Kyle Katarn: > > If you allow me, I would update the RFC to add this new implementation > > listed on it, remove the "Open issues" section if you don't see any > > with &

[PHP-DEV] [RFC] Add clamp function

2025-08-19 Thread Kyle Katarn
Hello, I took a look at thinkverse work on https://wiki.php.net/rfc/clamp and on the open issues (handling NAN and other comparable values not being integer nor float). This new implementation should resolve those issues: https://github.com/php/php-src/pull/19434