<?php declare(strict_types = 1);
/** @param non-empty-list<mixed> $foo */
function sayHello($foo): void
{
}
/** @return list<int> */
function getList(): array {
return [];
}
$a = getList();
$a[] = 1;
sayHello($a);
I'm not sure if it's possible in the current PHPStan... Just wondering. It'd be great to detect this.