Skip to content

impure methods don't reset static field state #4443

@dktapps

Description

@dktapps

Bug report

As per title.

Code snippet that reproduces the problem

https://phpstan.org/r/39bbbf31-89cb-4835-9423-3e0dcd672244
https://3v4l.org/SoH1D

Expected output

An error should be reported on line 18, because self::$arr could be null thanks to the impure self::setup() call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions