Skip to content

Does not detect implicit int -> float conversion when null is allowed #1711

@jankonas

Description

@jankonas

Summary of a problem or a feature request

Code speaks for 1000 words ⬇️ 😉

Array content detection reports that int is present in the array and float|null is expected when the called function requests ?float parameter. The detection behaves correctly when only float parameter is requested.

Code snippet that reproduces the problem

https://phpstan.org/r/1e51242a-89bd-481a-b6a1-3c0cc173b7d5

Expected output

Linked code snippet should not report any issues.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions