Skip to content

Document clamp function#4814

Open
kylekatarnls wants to merge 1 commit into
php:masterfrom
kylekatarnls:clamp-function
Open

Document clamp function#4814
kylekatarnls wants to merge 1 commit into
php:masterfrom
kylekatarnls:clamp-function

Conversation

@kylekatarnls

Copy link
Copy Markdown
Contributor

@kylekatarnls
kylekatarnls force-pushed the clamp-function branch 2 times, most recently from 19f924c to 1b1ac7b Compare November 19, 2025 09:41
@kylekatarnls
kylekatarnls marked this pull request as ready for review December 7, 2025 15:23
@lacatoire

Copy link
Copy Markdown
Member

LGTM, clear, consistent with the RFC, the implementation, and the tests.

Thanks for adding this @kylekatarnls

nicolas-grekas added a commit to symfony/polyfill that referenced this pull request Apr 10, 2026
This PR was merged into the 1.x branch.

Discussion
----------

[8.6] Add `clamp` function

RFC: https://wiki.php.net/rfc/clamp_v2
Original implementation: php/php-src#19434
Documentation: php/doc-en#4814

Commits
-------

2b4c47d [8.6] Add `clamp` function

@jordikroon jordikroon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot merge this yet as 8.6 isn't released yet.
Mostly doc style comments.

Since date comparison is a big part of this RFC. We should document this explicitly here as well. Not only within the examples section.

Comment thread appendices/migration86/new-functions.xml
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
Comment thread reference/math/functions/clamp.xml Outdated
@jordikroon jordikroon added this to the PHP 8.6 milestone May 18, 2026
@kylekatarnls
kylekatarnls force-pushed the clamp-function branch 5 times, most recently from 86898b3 to 934bbb8 Compare July 18, 2026 12:55
@kylekatarnls

Copy link
Copy Markdown
Contributor Author

Hello @jordikroon I hope I didn't forgot any fix.

FTR, the markup was inspired by min.xml and max.xml. So if those here are to be fixed, then probably the errors are to be fixed in min.xml and max.xml.

@jordikroon jordikroon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kylekatarnls. This looks good. This will stay open for a while but in its current state no further action required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants