1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Fix docs example for impurity

This commit is contained in:
Brown 2019-08-07 15:39:51 -04:00
parent 955899ade0
commit 04c12a36fe

View File

@ -337,9 +337,20 @@ takesString(new A);
Emitted when calling an impure function from a function or method marked as pure.
```php
function impure(array $a) : array {
/** @var int */
static $i = 0;
++$i;
$a[$i] = 1;
return $a;
}
/** @psalm-pure */
function filterOdd(array $a) : void {
extract($a);
impure($a);
}
```