mirror of
https://github.com/danog/psalm.git
synced 2024-12-11 16:59:45 +01:00
21 lines
309 B
Markdown
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"];
|
|
```
|