mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
[RFC] Add clamp function (#19434)
* Implement clamp function Co-authored-by: thinkverse <hallberg.kim@gmail.com> * - Use a common function for normal and frameless implementations - Add tests for null and not-comparable cases - Fix object support for frameless clamp function - Improve NAN handling * Create tests triggering both frameless and dynamic variants * Add changelog * [Review] rephrase error messages to use "must not" * Enable assert() --------- Co-authored-by: thinkverse <hallberg.kim@gmail.com>
This commit is contained in:
@@ -71,6 +71,10 @@ PHP 8.6 UPGRADE NOTES
|
||||
6. New Functions
|
||||
========================================
|
||||
|
||||
- Standard:
|
||||
. `clamp()` returns the given value if in range, else return the nearest bound.
|
||||
RFC: https://wiki.php.net/rfc/clamp_v2
|
||||
|
||||
========================================
|
||||
7. New Classes and Interfaces
|
||||
========================================
|
||||
|
||||
Reference in New Issue
Block a user