Bug report
If you call DateTimeImmutable::createFromInterface on a class CustomDateTimeImmutable extends DateTimeImmutable, Phpstan thinks it will return DateTimeImmutable, but it will actually return the specific CustomDateTimeImmutable.
Interestingly enough createFromFormat is analysed correctly.
Code snippet that reproduces the problem
https://phpstan.org/r/070552d2-d2a8-406c-9846-10e6cf44d651
https://3v4l.org/oBrlZ
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
Phpstan 1.6 is really nice :)