Skip to content

[8.6] Add clamp function#554

Merged
nicolas-grekas merged 1 commit intosymfony:1.xfrom
kylekatarnls:feature/clamp
Apr 10, 2026
Merged

[8.6] Add clamp function#554
nicolas-grekas merged 1 commit intosymfony:1.xfrom
kylekatarnls:feature/clamp

Conversation

@kylekatarnls
Copy link
Copy Markdown
Contributor

@kylekatarnls kylekatarnls commented Nov 19, 2025

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

@nicolas-grekas
Copy link
Copy Markdown
Member

That would be for PHP 8.6, isn't it?

Comment thread src/Php85/Php85.php Outdated
@kylekatarnls
Copy link
Copy Markdown
Contributor Author

That would be for PHP 8.6, isn't it?

Correct, moving it.

@kylekatarnls kylekatarnls force-pushed the feature/clamp branch 2 times, most recently from 5bbf49c to d88b259 Compare November 19, 2025 09:53
@kylekatarnls kylekatarnls changed the title [8.5] Add clamp function [8.6] Add clamp function Nov 19, 2025
@kylekatarnls kylekatarnls force-pushed the feature/clamp branch 3 times, most recently from bead94d to c9033e5 Compare November 19, 2025 10:45
@kylekatarnls kylekatarnls marked this pull request as ready for review November 19, 2025 18:05
@kylekatarnls kylekatarnls reopened this Dec 7, 2025
@kylekatarnls
Copy link
Copy Markdown
Contributor Author

kylekatarnls commented Dec 19, 2025

php/php-src#19434 is merged (will land in PHP 8.6)

Comment thread src/Php86/Php86.php Outdated
Comment thread src/Php86/bootstrap.php
Comment thread src/Php86/Php86.php Outdated
Comment thread src/Php86/Php86.php
Copy link
Copy Markdown
Contributor

@Ayesh Ayesh left a comment

Choose a reason for hiding this comment

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

Added a very minor nitpick.

@kylekatarnls kylekatarnls requested a review from Ayesh January 8, 2026 17:41
Comment thread src/Php86/Php86.php Outdated
@kylekatarnls
Copy link
Copy Markdown
Contributor Author

Hello @fabpot @nicolas-grekas, do you need anything else for this?

@lyrixx
Copy link
Copy Markdown
Member

lyrixx commented Mar 2, 2026

Failures seems related:

e 2 errors:

1) Symfony\Polyfill\Tests\Php86\Php86Test::testClamp
TypeError: Argument 1 passed to Symfony\Polyfill\Tests\Php86\clamp() must be an instance of Symfony\Polyfill\Tests\Php86\mixed, integer given, called in /home/runner/work/polyfill/polyfill/tests/Php86/Php86Test.php on line 20

/home/runner/work/polyfill/polyfill/tests/Php86/Php86Test.php:20

2) Symfony\Polyfill\Tests\Php86\Php86Test::testClamp
TypeError: Polyfills enabled, Argument 1 passed to Symfony\Polyfill\Tests\Php86\clamp() must be an instance of Symfony\Polyfill\Tests\Php86\mixed, integer given, called in /home/runner/work/polyfill/polyfill/tests/Php86/Php86Test.php on line 20

/home/runner/work/polyfill/polyfill/tests/Php86/Php86Test.php:20

Comment thread src/Php86/bootstrap.php Outdated
Comment thread tests/Php86/Php86Test.php Outdated
@kylekatarnls kylekatarnls force-pushed the feature/clamp branch 2 times, most recently from bf53583 to bc933be Compare March 3, 2026 17:41
@kylekatarnls kylekatarnls requested a review from stof March 14, 2026 17:08
@nicolas-grekas
Copy link
Copy Markdown
Member

Thank you @kylekatarnls.

@nicolas-grekas nicolas-grekas merged commit b8eadc1 into symfony:1.x Apr 10, 2026
1 of 9 checks passed
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.

6 participants