Skip to content

2.1.27: dynamicConstantNames "Offset mixed might not exist" with constants in array-dim-fetch #13538

@staabm

Description

@staabm

Bug report

using phpstan.neon:

parameters:
    reportPossiblyNonexistentConstantArrayOffset: true
    reportPossiblyNonexistentGeneralArrayOffset: true

    dynamicConstantNames:
        LOG_DIR: non-empty-string

we get a

Offset mixed might not exist on non-empty-array.

error on line 10 while the offset will definitly exist

Code snippet that reproduces the problem

https://phpstan.org/r/7f5885a6-03c1-4110-a2bd-dfc868470d33

Expected output

no error on line 10

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions