Bug report
new Foo(); on a separate line does not report an error when Foo's constructor is impure or throws an exception.
However, new class() extends Foo {}; gives an error: Expression "new class extends \Foo…" on a separate line does not do anything.
In the code snippet below, uncommenting line 18-21 removes the error.
Code snippet that reproduces the problem
https://phpstan.org/r/f73606f1-2de1-4e6a-950b-c2058ba08c87
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response