vimeo/psalm

Emit an issue when using coalesce operator if the first operand can't be null

Open

#7,101 opened on 2021年12月8日

GitHub で見る
 (10 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedenhancement

Repository metrics

Stars
 (5,369 stars)
PR merge metrics
 (平均マージ 3d 12h) (30d で 5 merged PRs)

説明

https://psalm.dev/r/154ffd42b2

/** @var string $q */
$a = explode(',', $q);

return $a[0] ?? '';

Should've resulted in TypeDoesNotContainNull but not.

Compare with:

https://3v4l.org/pgbW6

コントリビューターガイド