Skip to content

DisallowedLooseComparisonRule should exclude DateTime(Immutable) #252

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

Closed
karstennilsen opened this issue Nov 28, 2024 · 2 comments
Closed

Comments

@karstennilsen
Copy link

karstennilsen commented Nov 28, 2024

(new \DateTimeImmutable('2024-05-02 00:00:00')) === (new \DateTimeImmutable('2024-05-02 00:00:00'))
// returns false

Strict comparison makes not a lot of sense for DateTime objects in PHP. I like the rest to be strict in comparison, but not this.

@ondrejmirtes
Copy link
Member

Duplicate of #232

@ondrejmirtes ondrejmirtes marked this as a duplicate of #232 Nov 28, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants