Skip to content

Expression result remembered on new() #8985

Description

@gndk

Bug report

The result of an expression is remembered when using a new instance of the object, which causes a false error.

Code snippet that reproduces the problem

https://phpstan.org/r/5b7c94e7-f956-41ec-9ea3-7da02d6aed32

Its works as expected when using an intermediate variable:

https://phpstan.org/r/16dacfb5-9deb-4076-8db3-418d742e7c9a

Expected output

No error.

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

It helps a ton! Thank you for your work 🥇

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions