Skip to content

array_count_values array key inference broken since 2.1.34 #13996

@janedbal

Description

@janedbal

Bug report

  • For string data, it infers string keys, but it should not
  • Inference was ok prior 2.1.34

Code snippet that reproduces the problem

https://phpstan.org/r/b5fae275-672d-4795-be8e-490b19505397

Expected output

Dumped type: non-empty-array<array-key, int<1, max>>

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions