Skip to content

Limit max size of ConstantArrayType #3055

@muglug

Description

@muglug

Feature request

Adding the lines

if (count($node->items) > 100) {
    $arrayBuilder->degradeToGeneralArray();
}

in https://github.com/phpstan/phpstan-src/blob/4d6904354ecd8df4f82e6b9b69925e4266d3f241/src/Analyser/MutatingScope.php#L1227

massively improves performance when handling large arrays

ref #1275

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