Bug report
This works
if (($obj instanceof ClassA) || ($obj instanceof ClassB)) {
$obj->sayHello();
}
and this does not:
$isHelloWorld = $obj instanceof ClassA;
$isHelloWorld2 = $obj instanceof ClassB;
if ($isHelloWorld || $isHelloWorld2) {
$obj->sayHello(); // <- Cannot call method sayHello() on mixed.
}
The variable types are not being picked up when passed through a variable like this.
Code snippet that reproduces the problem
https://phpstan.org/r/19a7c6f9-38b1-4557-9348-d702baa1de9b
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
This works
and this does not:
The variable types are not being picked up when passed through a variable like this.
Code snippet that reproduces the problem
https://phpstan.org/r/19a7c6f9-38b1-4557-9348-d702baa1de9b
Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
No response