Skip to content

[13.x] Add Carbon clamp method#59837

Closed
lucasmichot wants to merge 5 commits into
laravel:13.xfrom
lucasmichot:13.x-carbon-clamp
Closed

[13.x] Add Carbon clamp method#59837
lucasmichot wants to merge 5 commits into
laravel:13.xfrom
lucasmichot:13.x-carbon-clamp

Conversation

@lucasmichot
Copy link
Copy Markdown
Contributor

Add Carbon clamp method

@github-actions
Copy link
Copy Markdown

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

Comment thread src/Illuminate/Support/Carbon.php Outdated
@lucasmichot lucasmichot marked this pull request as ready for review April 25, 2026 07:05
@jnoordsij
Copy link
Copy Markdown
Contributor

Just ran into this and was really surprised to find this, mostly due to the fact that this aims to add functionality that will be available in PHP natively (see also https://wiki.php.net/rfc/clamp_v2 and #59858) and can be leveraged here with a polyfill.

But what really got me is that this aims to introduce Carbon-specific functionality here, rather than within Carbon itself, where the maintainer of Carbon is the author of the PHP native method. So I'm really wondering: is there anything that the new native clamp function can't do (for Carbon) and if so, why not add it there?

@lucasmichot lucasmichot deleted the 13.x-carbon-clamp branch April 26, 2026 17:56
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