1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-11 16:59:45 +01:00
psalm/docs/running_psalm/issues/PossiblyInvalidPropertyAssignmentValue.md

21 lines
309 B
Markdown
Raw Normal View History

2020-03-19 17:32:49 +01:00
# PossiblyInvalidPropertyAssignmentValue
Emitted when trying to assign a possibly invalid value to a typed property.
```php
2020-03-21 00:13:46 +01:00
<?php
2020-03-19 17:32:49 +01:00
class A {
/** @var int[] */
public $bb = [];
}
class B {
/** @var string[] */
public $bb;
}
$c = rand(0, 1) ? new A : new B;
$c->bb = ["hello", "world"];
```