Calling ReflectionClass::isSubclassOf() multiple times doesn't narrow types correctly in 8.4
Bug report
The result is correct up to 8.3, but *NEVER* in 8.4 for some reason.
Code snippet that reproduces the problem
https://phpstan.org/r/52a81990-cb4a-4e1b-b638-c5f9b39a5688
Expected output
The same output on all PHP versions
Did PHPStan help you today? Did it make you happy in any way?
No response
TypeSpecifying is here https://github.com/phpstan/phpstan-src/blob/e870ac104cdf2b6ce67aed0d6e7e1f5cbce9b07f/src/Type/Php/ReflectionClassIsSubclassOfTypeSpecifyingExtension.php#L20
One thing to know is the fact that the ReflectionClass stub change in PHP 8.4 https://github.com/phpstan/phpstan-src/blob/e870ac104cdf2b6ce67aed0d6e7e1f5cbce9b07f/src/PhpDoc/ReflectionClassStubFilesExtension.php#L9
Template type is not covariant anymore https://github.com/phpstan/phpstan-src/blob/e870ac104cdf2b6ce67aed0d6e7e1f5cbce9b07f/stubs/ReflectionClass.stub#L6 vs https://github.com/phpstan/phpstan-src/blob/e870ac104cdf2b6ce67aed0d6e7e1f5cbce9b07f/stubs/ReflectionClassWithLazyObjects.stub#L6
Maybe it imply some fix on TypeSpecifyingExtension side...