Skip to content

Exponential time increase when evaluating large OR conditions #9690

@survik1

Description

@survik1

Bug report

Since 1.10.22 PHPStan evaluating OR conditions take significantly more time, in our case it even freeze PHPStan to death, no matter how much HW we give it. The content of OR condition matters not, its just the OR condition itself.

100 OR conditions on my professional laptop take 6 min to evaluate. In version 1.10.21 it took just about 10 seconds. I am sharing a snippet with 50 conditions that crashes the playground. I had to comment some conditions as sharing was crashing too.

Code snippet that reproduces the problem

https://phpstan.org/r/e2ce161b-d483-47a1-976c-06a0a5a4fd8e

Expected output

[the analysis should had finished]

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