Bug #13118

Avoid PHP Warning: count(): Parameter must be an array or an object that implements Countable

Added by José Raddaoui Marín over 2 years ago. Updated over 1 year ago.

Status:NewStart date:07/23/2019
Priority:MediumDue date:
Assignee:José Raddaoui Marín% Done:


Target version:-
Google Code Legacy ID: Tested version:
Sponsored:No Requires documentation:


In PHP 7.2, count() will throw a warning on invalid countable types:


We should try to avoid that warning as it may lead to unexpected issues in the future. For example (the latest count in):


count_warnings.png (194 KB) José Raddaoui Marín, 08/07/2019 08:25 AM


#1 Updated by José Raddaoui Marín over 2 years ago

See https://stackoverflow.com/questions/49662029/count-emitting-an-e-warning for more info on why this could be a problem and possible solutions.

#3 Updated by Dan Gillean over 1 year ago

  • Target version deleted (Release 2.6.0)

Also available in: Atom PDF