vimeo/psalm

implode(<non-false-string>, array) should produce non-falsy-string

Open

#7,055 opened on Dec 4, 2021

 (2 comments) (0 reactions) (0 assignees)PHP (668 forks)batch import
Help wantedeasy problemsenhancementtype providers

Repository metrics

Stars
 (5,369 stars)
PR merge metrics
 (PR metrics pending)

Description

When the first argument is a non-falsy-string and the second argument has at least two elements, then the result is guaranteed to be at least non-falsy-string.

<?php

if(implode(' ', ['',''])) echo 1;

https://psalm.dev/r/19514cf5db

Contributor guide