-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed #74529 - DateTime::diff seems to ignore $absolute = true #2509
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
Conversation
ext/date/lib/interval.c
Outdated
{ | ||
timelib_rel_time *rt; | ||
timelib_time *swp; | ||
timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0; | ||
timelib_time one_backup, two_backup; | ||
|
||
rt = timelib_rel_time_ctor(); | ||
rt->invert = 0; | ||
rt->invert = absolute ? 1 : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If absolute
has a boolean value, then is this branch really needed? rt->invert = absolute;
should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds reasonable, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be IS_TRUE IS_FALSE can instead 1 AND 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@motecshine the thing is that we don't need branch at all.
ee6899e
to
65d4990
Compare
Changes to timelib need to be made upstream. /cc @derickr |
What @krakjoe said: Change to timelib need to be made upstream: http://github.com/derickr/timelib |
@derick thanks! appropriate changes to |
@andrewnester I'm going to close this PR, please bump the upstream PR and open a clean PR containing only the test when upstream has merged your changes. |
Fixed https://bugs.php.net/bug.php?id=74529