In PHP 7.2+, null can no longer be passed to count(); its argument must implement the Countable interface. The simplest fix is passing a blank array instead of null. count([]) returns the same int 0 that count(null) used to, so no other changes are needed.
In PHP 7.2+, null can no longer be passed to count(); its argument must implement the Countable interface. The simplest fix is passing a blank array instead of null. count([]) returns the same int 0 that count(null) used to, so no other changes are needed.