Skip to content

Detect Assignment to Unused Variable #12789

Closed
phpstan/phpstan-src
#6330

Description

@oleibman

Feature request

An assignment to an otherwise unused variable can indicate a typo in nominally "correct" code. See https://phpstan.org/r/d60aae42-522a-4bc5-823c-ac895016be53
This bears some relation to issue #12012, but I think it is distinct enough to stand on its own.

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

I am quite pleased with it. Even the daunting exercise to convert our code base from level 8 to level 9 has proven very instructive. (I know there's now a level 10, which I will get to eventually.)

Activity

  1. mvorisek commented on Sep 9, 2025

    @mvorisek
    Contributor
  2. mikethea1 commented on Mar 11, 2026

    @mikethea1
  3. oleibman commented on Sep 10, 2026

    @oleibman
    Author

    Thank you.

  4. github-actions commented on Oct 12, 2026

    @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.

  5. locked as resolved and limited conversation to collaborators on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions