Bug report
Similar to #8537 there is still an issue when a variable is type-hinted with an interface that has a @property, or @property-read declaration. From PHP8.2 onwards PHPStan is unable to recognise these declarations on interfaces.
/**
* @property int $x
* @property-read int $y
* @property-write int $z
*/
interface SampleInterface
{
}
function test(SampleInterface $test): void
{
echo $test->x;
echo $test->y;
$test->z = 5;
}
Code snippet that reproduces the problem
https://phpstan.org/r/a199e998-8445-4590-9942-fe4b04a704bd
Expected output
No errors!
Did PHPStan help you today? Did it make you happy in any way?
No response