Skip to content

detect local dead code and assigments #12012

Closed
phpstan/phpstan-src
#6330

Description

@staabm

Feature request

when refactoring, sometimes a typo slips in which leads to the following code

https://phpstan.org/r/b10350ea-45dc-4497-9d40-9504593b0c01

the typo is that I missed the . before = on line 10, so the code is overridding the initially build string instead of appending to it.
this also means the code on line 7/8 is now effictively dead.

if we could detect the dead assignments, it would help me to spot the missing .=

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

No response

Activity

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

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