vimeo/psalm

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

Open

#7101 aperta il 8 dic 2021

Vedi su GitHub
 (10 commenti) (0 reazioni) (0 assegnatari)PHP (668 fork)batch import
Help wantedenhancement

Metriche repository

Star
 (5369 star)
Metriche merge PR
 (Merge medio 3g 12h) (5 PR mergiate in 30 g)

Descrizione

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

Guida contributor