-
Notifications
You must be signed in to change notification settings - Fork 7.9k
RFC: Deprecate date constant RFC7231 #12989
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
base: master
Are you sure you want to change the base?
Conversation
Adding this to the mass deprecation makes sense, but I would want to wait for @derickr's opinion, but he's on holidays for 2 (3?) weeks. Please ping us again in January if we forget this :/ |
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.
I am ok with this being added to the 8.4 deprecations. I wonder whether we can also not clean up some of the tests to not even use this constant in there, as there are now so many deprecation warnings in the test. I suggest we only keep the tests for these constants for DateTimeInterface_constants. No biggy though, but just as well we can clean up something here.
Is this still part of the deprecation list for 8.4? |
Unfortunately no. I completely forgot about this PR and I didn't add this for the 8.4 deprecations collection. I will add for the next one. |
fcd7c96
to
97eed82
Compare
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.
Test failures are legit.
/** | ||
* @var string | ||
* @cvalue DATE_FORMAT_RFC7231 | ||
* @deprecated | ||
*/ | ||
const DATE_RFC7231 = "D, d M Y H:i:s \\G\\M\\T"; |
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.
Use the \Deprecated
attribute
/** @deprecated */ | ||
public const string RFC7231 = DATE_RFC7231; |
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.
Use the \Deprecated
attribute
This PR deprecates constants
DATE_RFC7231
andDateTimeInterface::RFC7231
.Because the implementation of the constant contains the timezone
GMT
designation, the format of date will always show theGMT
timezone, despite the real timezone of the instance ofDateTimeInterface
. This may lead to unwanted results.The implementation of this constant was a mistake, as this was described as bug. This wasn't bug, this was missing functionality: #2450
Example of wrong display of datetime:
https://3v4l.org/5Oh7Z
I also suggest adding this to the collective RFC https://wiki.php.net/rfc/deprecations_php_8_4 What do you think @Girgias?