Skip to content

php8's match: result of void is used #4292

@jkuchar

Description

@jkuchar

Bug report

Even when result of match() is not used, phpstan reports that arm of match that contains fn which returns void is invalid. https://3v4l.org/Tcge3 (no error)

Code snippet that reproduces the problem

https://phpstan.org/r/aae87ebf-09e9-4bd1-a13b-2a39ff9af6f3

Expected output

PHPStan should ignore cases when match() result is not used, no matter what inner function returns.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions