Skip to content

False positive for preInc.unused after upgrading to 2.3.0 #15411

Description

@kallesommernielsen

Bug report

When using ++ as a unary pre operator, then PHPStan seems to disregard the actual return value if its used in a context where a return value makes sense, e.g. a return value, function call, ...

Code snippet that reproduces the problem

https://phpstan.org/r/ebea5aeb-4152-417f-ba73-f924bf3f4dd0

Expected output

No error

Did PHPStan help you today? Did it make you happy in any way?

No response

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions