Skip to content

preg_match call with named arguments incorrect type inference #13088

@ondrejmirtes

Description

@ondrejmirtes

Bug report

The two calls in the snippet are equivalent imho. /cc @staabm

Code snippet that reproduces the problem

https://phpstan.org/r/b6052ec1-675c-4484-9cea-b7da24c7a506

Expected output

array{non-falsy-string, string} for both.

I don't know if this is an issue with the extension or maybe with default value in a stub, or maybe with ArgumentsNormalizer.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions