vimeo/psalm

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

Open

#7.101 aberto em 8 de dez. de 2021

Ver no GitHub
 (10 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedenhancement

Métricas do repositório

Stars
 (5.369 stars)
Métricas de merge de PR
 (Mesclagem média 3d 12h) (5 fundiu PRs em 30d)

Description

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

Guia do colaborador