title: Warning: count() on Prestashop
body: <p>recently this warning appears on my site</p>
  <blockquote>
  <p>Warning: count(): Parameter must be an array or an object that implements Countable in /home/n4t0r13nt3/public_html/modules/posstaticfooter/models/Staticfooter.php on line 55&quot;</p>
  </blockquote>
  <p>i am using php 7.2. On block there are these instructions:</p>
  <pre><code>$newObject = array();
  if(count($newObject&gt;0)) {
      foreach($object as $key=&gt;$ob) {
          $nameModule = $ob['name_module'];
          $hookModule = $ob['hook_module'];
          $blockModule = $this-&gt;getModuleAssign($nameModule, $hookModule);
          $ob['block_module'] = $blockModule;
          $description = $ob['description'];
          $description = str_replace('/pos_organicfood/',PS_BASE_URI,$description);
          $ob['description'] = $description;
          
  // array_push($ob, $blockModule);
          if($ob['is_default'] ==1) {
  //$ob['description'] = str_replace(PS_BASE_URI.'img/cms',PS_BASE_URI.'modules/posstaticblocks/images', $ob['description']);
          }
          $newObject[$key] = $ob;
      } return $newObject;
  } return null;
  }
  </code></pre>
  <p>I tried to change the instruction <code>if(count($newObject&gt;0))</code> to <code>if (array($newObject) &amp;&amp; count($newObject) &gt; 0)</code> reading another post on Magento (I'm using Prestashop). What could it depend on? Thanks to those who will want to answer. I hope I haven't violated any rules.</p>