Re: [RFC] [Discussion] Add clamp function
| From: | Morgan | Date: | Thu, 28 Aug 2025 10:59:27 +0000 |
| Subject: | Re: [RFC] [Discussion] Add clamp function | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128581@lists.php.net to get a copy of this message | ||
On 2025-08-28 19:37, Tim Düsterhus wrote:
There's precedent in ext/random with the Randomizer::getFloat() method that takes a Random\IntervalBoundary enum to decide on the the interpretation of the boundary values. Translated to clamp() this could mean:
If it weren't living in the Random extension, that very Enum could have been used.