Skip to content

False positive is_numeric with checkAlwaysTrueCheckTypeFunctionCall:true and treatPhpDocTypesAsCertain:false #5695

@noemi-salaun

Description

@noemi-salaun

Bug report

PHPStan with rule checkAlwaysTrueCheckTypeFunctionCall: true reports that is_numeric is always true, even if I use treatPhpDocTypesAsCertain: false when using array shape + OR operator.

If I remove the first part of the if, PHPStan does not warn about the is_numeric

Code snippet that reproduces the problem

https://phpstan.org/r/2eaa5802-f20b-4698-ac88-079333a2e4fc

Expected output

PHPStan should not display any errors

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions