Skip to content

abs() return type ignores specific input ranges #11367

@julienfalque

Description

@julienfalque

Bug report

When the type of the input given to abs() excludes some values, PHPStan doesn't know that those values cannot be returned.

Code snippet that reproduces the problem

https://phpstan.org/r/495b6ded-343d-4852-bf9a-757cc95de438

Expected output

No error.

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