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
Implement DateComparableInterval #4063
Conversation
Wonderful @nikic, I did not expect this PR/feature so soon! Regarding the name, a class If we would name it
So my suggestion would be to name it @nikic: why should we want to make the constructor private? I understand that the constructor should be limited if we want to make it public (probably (milli)seconds |
I think we should work on an RFC for this first @nikic |
@derickr First need to decide what the RFC is supposed to propose ;) @frederikbosch A possible feature for DateAbsoluteInterval would be to get the total number of seconds.
We could allow anything up to (and including) days. I'm not sure how useful this would really be. |
@derickr Any further thoughts on this? |
@nikic Pretty much what it says in the ticket for the RFC? |
@derickr Do you think this is still relevant? If not feel free to close this PR. |
I don't know. This PR certainly no longer applies, and changing the return of DateTime::diff() is a BC break. I'm therefore closing this and if somebody is interested again we can revisit. |
Following @derickr's suggestion in #4039, this changes DateTime::diff() to return a new DateComparableInterval class, which has well-defined comparison semantics.
TODO:
cc @frederikbosch @Antnee