Hi @ondrejmirtes 👋
I hope you are doing well 🐥
Bug report
I guess it's quite complicated to handle for stan, but this code cannot lead to null variables.
Code snippet that reproduces the problem
https://phpstan.org/r/931d0b76-f815-483d-916a-06621509fe55
I thought the fake positive was happening because of the cast to int, making it hard for phpstan to acknowledge null values throw exceptions. But actually it's the same with an is_null method: https://phpstan.org/r/1a0ff9f2-ac6e-467e-89dc-ee21ca721962
Expected output
No warning raised. Both properties can only be int.