Skip to content

Invalid error for float type check using 0 #1961

@rimvislt

Description

@rimvislt

Summary of a problem or a feature request

Using 0 as default parameter for float type argument gives error:
Default value of the parameter #1 xx of method nn is incompatible with type float.

Code snippet that reproduces the problem

public function test2(float $test2 = 0): void { //}
https://phpstan.org/r/83d22916-c7a8-4bc3-8d37-27b361326329

Expected output

No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions