Skip to content

Strict comparison using !== between 0.0 and 0 will always evaluate to true. #6086

Closed

Description

@mvorisek

Bug report

Error for !== operator should be consistent as for ===.

Code snippet that reproduces the problem

https://phpstan.org/r/7a167f93-8063-4c94-a9a9-a12ca1532370

Expected output

 Line | Error
 5 | Strict comparison using === between 0.0 and 0 will always evaluate to false.
+7 | Strict comparison using !== between 0.0 and 0 will always evaluate to true.

Activity

  1. ondrejmirtes commented on Nov 25, 2021

    @ondrejmirtes
    Member
  2. mvorisek commented on Nov 25, 2021

    @mvorisek
    ContributorAuthor

    but why === is reported in standard phpstan then? I think the same category operator should work the same.

  3. github-actions commented on Dec 27, 2021

    @github-actions

    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.

  4. locked as resolved and limited conversation to collaborators on Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions