Skip to content

phpstan thinks get_defined_vars() contains "this", but it does not #13881

@LorisZ

Description

@LorisZ

Bug report

When using the function get_defined_vars() inside a method of a class, phpstan thinks the array should contain "this", but it does not.

Code snippet that reproduces the problem

https://phpstan.org/r/72384f2b-f867-4b49-b9e0-3d8b3d811546

Expected output

No error expected.

When uncommenting the line with //unset($values["this"]);, phpstan does not give an error anymore. but executing the php code works either way.

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions