Re: [RFC] Add clamp function
| From: | Christoph M. Becker | Date: | Sat, 23 Aug 2025 09:26:02 +0000 |
| Subject: | Re: [RFC] Add clamp function | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-128539@lists.php.net to get a copy of this message | ||
On 22.08.2025 at 22:09, Larry Garfield wrote:
> Though apparently what PHP currently does with Point comparisons in min/max is... weird. I
> don't even know what the logic here is. :)
>
> https://3v4l.org/pTmiV
That's the usual PHP object/array comparison [1]: 10 > 2, and 5 < 10.
The $y member isn't even checked. See
<https://www.php.net/manual/en/language.operators.comparison.php#example-167>.
Christoph