JakubMisek Ray it seems it's an excessive null check diagnostic; For empty arrays, it makes sense; calling array_shift() is unnecessary. But does it happen anywhere else in the code, where array is not empty?
Ray The use case is when there is logic that does not get triggered and does not change the $array. $array = []; if(false) { $array[] = ["value"]; } $value = array_shift($array);
JakubMisek Ray still not sure about array_shift() on definitely empty array, like $a = array_shift([]); that may be an issue in the code because it's always null.
Jean-FrancoisHIVERT Same issue with reset() function: Assiging void from a function reset() PHP(PHP1408)
DonaldWinston The function "reset" is still getting reported with this error. I have version v1.27.12010. Updated today.