-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[RFC] Add clamp function #7191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Add clamp function #7191
Conversation
Is there a cleaner way to handle |
Remove useless NAN check Update clamp tests
@nikic this RFC missed the voting window and can be removed from the 8.1 milestone, the proposed version is now targeting the 8.2 release. |
@thinkverse Nice work man! |
@thinkverse Are you still interested in pursuing this for PHP 8.2? |
Yeah. Nikita helped with the NaN issue a while back so that should be considered solved. If there are no other glaring issues left it should be OK to open up voting on I think. I've been holding off until other more major RFCs' have been voted on since this could be considered a low priority one compared to the rest. |
The clamp() function could be used optionally in userland implementations. Looking forward to is addition in PHP 8.2 or in future |
@thinkverse Any progress? Remember that feature freeze is very soon. |
Great work! Looking forward to seeing it implemented in PHP 8.3 hopefully 🤞 |
Is this function likely to make it into 8.3? Any reason this hasn't gone to a vote yet? |
Would be great if the clamp function makes it into php 8.3! |
I have made the difficult decision to withdraw the RFC, I currently don't have the resources or bandwidth for it. If anyone would like to take it over they are more than welcome to, I apologize to anyone who was looking forward to this. 🙏 |
pity, that would be a nice feature. But I can well understand your decision. Unfortunately, I have neither resources nor experience with php-RFC, so I can't step in.. |
I was actually surprised that it's still not in PHP. Sad that it didn't make it. |
I'm giving it another try (#19434) reusing your initial work @thinkverse, your comments on it are welcome 🙏 |
This PR adds an implementation for the RFC: https://wiki.php.net/rfc/clamp. any improvements are welcomed.
If you know how this function can be made faster and less cost-effective don't hesitate to point it out. 👍