vimeo/psalm

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

Open

#7,101 创建于 2021年12月8日

在 GitHub 查看
 (10 评论) (0 反应) (0 负责人)PHP (668 fork)batch import
Help wantedenhancement

仓库指标

Star
 (5,369 star)
PR 合并指标
 (平均合并 3天 12小时) (30 天内合并 5 个 PR)

描述

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

贡献者指南