-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Bug #68161 - DateTime::setTimestamp doesn't clear relative data #870
Conversation
I would like a second opinion on the expected behaviour here, with the following two methods:
The bug report identifies that if I can see how this can both be viewed as unexpected, and also useful, as in the following:
If it's decided the current behaviour is the expected behaviour, I will modify the test to ensure this behaviour remains unaltered. |
The modifications should happen only once, and not stick around. Your patch is not correct though, the unsetting of relative needs to happen after modify() has run the modification, and not in the setTimestamp() method as that only addresses the symptom, and not the problem. |
I would also target PHP 5.4 with the patch. |
@derickr Problem with targeting 5.4 is that Travis doesn't run the test suite for that branch =( |
Thanks @derickr, I will address this tonight. |
And, 5.4 is security fixes only. |
I'm not sure I understand this patch - why save and restore relative time? Shouldn't relative part be reset if we set explicit timestamp? |
I think I've failed to push a commit. I made a change based on Derick's feedback. I'll see if I can track it down. |
Changes Unknown when pulling 91d4185 on lt:bug-68161 into * on php:PHP-5.5*. |
The original bug is now marked closed on the systems bug tracker, so assume this is fixed in supported branches. |
Fixes PHP bug #68161 - Explicitly setting a timestamp does not clear previously set relative data.