count(null) returned zero, which meant a function returning null instead of an empty array produced a plausible number and no complaint. 7.2 warns.
count(null); // Warning: count(): Parameter must be an array or Countable
count('string'); // same
count(new stdClass()); // same
// the fix is usually upstream
public function lines(): array
{
return $this->lines ?: []; // never null
}
The warning is noisy on any older codebase and that noise is the point: every occurrence is a place where a null was being silently treated as an empty collection. Suppressing it with @ hides a real bug about a third of the time in my experience. Returning an empty array rather than null from anything array-shaped removes the whole category, and it is a better habit than guarding at each call site.