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

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : Warning: count(): Parameter must be an array or an object that implements Countable

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

par @rthur » 12 nov. 2019, 19:45

En corrigeant ton problème de parenthèses pour le count() ;-)

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

par kmchen » 12 nov. 2019, 11:23

la variable $this->_data est un array[63] généré dynamiquement au moment du warning sur la ligne

Code : Tout sélectionner

if ( count( $this->_data > 0 ) && $task != 'create' )
Comment éviter ce Warning: count(): Parameter must be an array or an object that implements Countable ?