On 2025-08-30 01:10, 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 finding the word “complexity” in https://wiki.php.net/rfc/clamp or https://externals.io/message/115050. Can you link to the message you are referring to?

I'm probably misremembering https://externals.io/message/128505#128532 and #128542.

reasons. The extra complication may not be worth it if there are only
two or three values being compared (long and double are the first types
zend_compare tries).

I'm positive that the benchmarks will answer that question.

Agreed. But if clamp doesn't need to special-case numeric inputs to perform well then maybe max/min don't either (at least not any more) and their implementations could be streamlined.

Best regards
Tim Düsterhus

Reply via email to