-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
⬆️ Make CarbonPeriod extend DatePeriod #1752
Comments
Thanks @imbrish, "soon" is probably not so true, because using a PHP 7.4 feature means dropping PHP 7.1, 7.2 and 7.3. And even just dropping PHP 7.1 can't happen until the next major version and only if we decide it's acceptable to drop it as this moment. Even if PHP 7.1 would be patched with this (let say PHP 7.1.31 contains the fix), it doesn't help since we need to drop PHP 7.1.8 to PHP 7.1.30 and it's also a breaking change for Carbon. So I would rather say if someday we're about to drop PHP < 7.4, it's something we can reconsider. |
Guess "soon" was in fact bit optimistic, but I used it as opposed to "never" 😄 Anyway if it's due to happen someday then it may be wise to go towards converging the implementation to match DatePeriod over the time. After having a brief look at the original pull request (#1270) I'm not sure if that's doable at all, for example because of the differences in handling recurrences. That's why I mentioned some research first, also to decide if it's a reasonable goal, given that people are satisfied with how CarbonPeriod is now. I dont' think it is all that common to use it as a DatePeriod replacement. |
I started a branch for a version 3. It will mostly be used to make some breaking changes about some behavior and default values that could be more consistent and remove some stuff. So I'm reconsidering |
Laravel 9 will drop PHP < 7.4, Carbon 3 will follow the move and so this is now in the run again for next major version. |
This will have to be postponed again as |
For now it's available requiring |
Available with |
Hei!
I haven't been actively developing in PHP since a year or so, but I'm still getting occasional updates from https://github.com/php/php-src. One of the news is that php/php-src#3121 have finally been merged! It'll be available in PHP 7.4 but I'm not sure about the earlier releases.
It may be then a good idea to think about making CarbonPeriod extend the DatePeriod. However, as we had to remake the thing from scratch, I'm not sure about the compatiblity, particularly as I don't know which versions of PHP should be supported by Carbon 2.
In any case I think I should be able to help with the research and refactoring after the sommer if you think that should be done :)
The text was updated successfully, but these errors were encountered: