Skip to content

Internal Error thrown at ConstantArrayTypeBuilder::setOffsetValueType() #7351

@taka-oyama

Description

@taka-oyama

Bug report

Upgrading to 1.7.3 and re-running analyze threw an Internal Error at code that was using array_pop in a loop.

The error only happens when there are more than 1 non-literal string item in the popped array.

I'm guessing it was caused by phpstan/phpstan-src#1352.

Code snippet that reproduces the problem

https://phpstan.org/r/8d3f63e7-9e1b-4935-a6be-73bc3908dc7f

Expected output

No Error.

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

I love how it keeps evolving everyday.

Many thanks to all the people working on it.

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