Skip to content

Offset 'test' on array{} on left side of ??= does not exist. after upgrade to 2.1.10 #12780

Closed
phpstan/phpstan-src
#5857

Description

@erjotek

Bug report

this extracted part of code works without problems before 2.1.9 on level 5

it's green with $user->missedOne = ['test'=>0]; but i can't set it, because "test" is just an example, in our code it's a dynamic label

Code snippet that reproduces the problem

https://phpstan.org/r/912982f5-43a7-426a-89bb-bddb9900545f

Expected output

no error

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

No response

Activity

  1. ondrejmirtes commented on Mar 24, 2025

    @ondrejmirtes
    Member

    because "test" is just an example, in our code it's a dynamic label

    Please create a more realistic example with a dynamic label instead. Thanks.

  2. erjotek commented on Mar 25, 2025

    @erjotek
    Author
  3. added this to the Easy fixes milestone on Sep 12, 2025
  4. github-actions commented on Oct 4, 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 4, 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