Skip to content

'Variable might not be undefined' in if-statement after in_array check. #12597

@mickverm

Description

@mickverm

Bug report

In order to fix the issue, I had to define $message = ''; before the in_array check.

Code snippet that reproduces the problem

https://phpstan.org/r/2e6aa27a-398a-4bd1-8f3a-44c004dfdb46

Expected output

No output

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

I use it daily and saved my code from subtle bugs time and time again❤

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions