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
2020-03-20 19:13:56 -04:00

21 lines
309 B
Markdown

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