Skip to content

Slow analysis with a big const array in a class #12159

@xPaw

Description

@xPaw

Bug report

See #11979 for context. Tested on phpstan 2.0.3

After a certain phpstan update, analyzing a file that had array accessors like in the sample code became way too slow, but I can't quite nail down which version exactly caused it.

Code snippet that reproduces the problem

https://gist.github.com/xPaw/f76227b0ea9e6fa477ba9928988dcac2

Expected output

Analysis finishes reasonably fast.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions