Should DateTimeInterface be obsolete as well? #52390
Unanswered
javaDeveloperKid
asked this question in
Q&A
Replies: 1 comment 3 replies
{{title}}
Something went wrong.
{{editor}}'s edit
{{actor}} deleted this content
.
{{editor}}'s edit
Something went wrong.
-
the DateTimeInterface itself is immutable. AFAIK Symfony wont anticipate DateTime anymore in its codebase.
im not sure it's a job for Symfony, ideally PHP solved this with simple |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{{title}}
{{editor}}'s edit
{{editor}}'s edit
-
I'm opening a discussion rather than issue despite of fact I know the response from the Core Team will be little (it's mostly stof that answers discussions)
I think it's unfortunate that at the moment Symfony uses DateTimeInterface as TH because this means we still support mutable version of DateTime (interface can't be implemented in the userland code so it's only DateTime vs DateTimeImmutable). We did a great job removing mutable version from the codebase but I think we should have gone one step further and discourage using mutable version by devs by forcing them to use immutable version if they want to use Symfony.
(if you add thumb down please justify in the comments section)
Beta Was this translation helpful? Give feedback.
All reactions