-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1047Labels
Milestone
Description
Bug report
PHPStan doesn't seem to realize that a property assignment can throw a TypeError.
Code snippet that reproduces the problem
https://phpstan.org/r/e4d99651-8429-4a59-8994-6f1f975d58a0
<?php declare(strict_types = 1);
class A {
public int $b;
}
$test = new A();
function setProp(string $prop, object $object): void {
try {
$object->$prop = "abc";
} catch (\TypeError $e) {
}
}Expected output
No error
Did PHPStan help you today? Did it make you happy in any way?
Yes, see my other stories ;-)