Skip to content

Variable might not be defined #7706

Closed
phpstan/phpstan-src
#6380

Description

@aivus

Bug report

When the variable is set in if conditions (both cover all execution cases) PHPStan reports an error.

Could be similar to #5805

Code snippet that reproduces the problem

https://phpstan.org/r/9ed5bd67-660e-4084-9848-13db4201e2c5

Expected output

No errors

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

PHPStan helps us every day to catch a possible errors on early steps.

Activity

  1. added this to the Dependent types milestone on Sep 21, 2022
  2. github-actions commented on Oct 13, 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.

  3. locked as resolved and limited conversation to collaborators on Oct 13, 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

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions