Skip to content

Incorrect 'Variable $value might not be defined.' #14117

Closed

Description

@MacGritsch

Bug report

The variable $value is definitely defined as the last if-statement (in which the variable is defined) is equal to the one in which it is used.

Code snippet that reproduces the problem

https://phpstan.org/r/1636b1d8-db9b-4247-a407-9d2a60a0b81e

Expected output

No issue should be shown becaue variable is defined.

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

Its a gereat tool! Thank you!

Activity

  1. added this to the Easy fixes milestone on Mar 3, 2026
  2. added a commit that references this issue on Mar 3, 2026
    7259b57
  3. added a commit that references this issue on Mar 4, 2026
    0c740e3
  4. phpstan-bot commented on Mar 4, 2026

    @phpstan-bot
    Contributor

    Closed via merging phpstan/phpstan-src#5125

  5. added 2 commits that reference this issue on Mar 4, 2026
    0c740e3
    98b4459
  6. github-actions commented on Apr 5, 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.

  7. locked as resolved and limited conversation to collaborators on Apr 5, 2026
  8. added a commit that references this issue on Apr 7, 2026
    48c6359
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions