Skip to content

Incorrect type narrowing of superglobal with dependent types #14421

Closed
phpstan/phpstan-src
#6380

Description

@claudepache

Bug report

This is a variation on #14411, with variable $a replaced with some key on some superglobal. Curiously, I can’t reproduce it when I replace the superglobal with a variable of type array.

Code snippet that reproduces the problem

https://phpstan.org/r/31cf6c8e-c600-4d2b-a060-93d1ee09845f

Expected output

No error on line 15

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

No response

Activity

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

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