Skip to content

Missing error when attempting to fetch by reference an array element of a readonly property #14243

Description

@claudepache

Bug report

PHPStan correctly complains when attempting to fetch a reference of a readonly property. However, it misses the case of attempting to fetch a reference of an array element of a readonly property, as in: https://3v4l.org/XMZr5

Code snippet that reproduces the problem

https://phpstan.org/r/3b8febb3-2a26-4245-be09-4a40868587cc

Expected output

The error on line 15 should also occur on lines 16 and 17.

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

No response

Activity

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

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions