Access to an undefined property object::$foo on instances of \stdClass #4472
-
When declaring a new instance of stdClass and trying to set the value of a property of that instance, I get Demo of the issue: https://phpstan.org/r/e4ecbdf9-83e6-45a5-b819-852353a38478
I don't understand why PHPStan complains about it. Any idea on how to fix this without ignoring the error (a solution I'd like to avoid)? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
PHPStan doesn't know that |
Beta Was this translation helpful? Give feedback.
PHPStan doesn't know that
$type_info
isstdClass
, justobject
. See: https://phpstan.org/r/8af5033b-c0f9-4e5e-90ea-e608fc12fd72