title: Warning: sizeof(): Parameter must be an array or an object that implements Countable php7.2
body: <p>I updated to PHP 7.2 and it created an array (no pun intended) of issues. I've been knocking them out (mostly these sizeof and count() warnings. The one error we have :</p>
  
  <blockquote>
    <p>Warning: sizeof(): Parameter must be an array or an object that implements Countable in /usr/www/domain/phpmyd/includes/class_registry.php on line 236</p>
  </blockquote>
  
  <p>I tried fixing it like this :<br>
  <code>if (sizeof($this-&gt;config) &lt; 1) {</code><br>
  To this:<br>
  <code>if (!empty($this-&gt;config) &amp;&amp;(sizeof($this-&gt;config) &lt; 1)) {</code></p>
  
  <p>But it creates lots more errors shown below, However, we fixed this one in the same way and it works perfectly. Changing this:<br>
  <code>if (0 &lt; sizeof($this-&gt;language)) {</code><br>
  To this:<br>
  <code>if (!empty($this-&gt;language) &amp;&amp; (0 &lt; sizeof($this-&gt;language))) {</code></p>
  
  <p>Took away basically the same error. Now, keep in mind, the above warning is the ONLY error left. Everything else works perfectly, however, if I do "fix" the warning, I get a bunch of errors that break the site and seem irrelevant. So, if I replace that first string all these errors appear:</p>
  
  <ul>
  <li>Warning: Use of undefined constant ADDON_DISCOUNT_CODES - assumed
  'ADDON_DISCOUNT_CODES' (this will throw an Error in a future version
  of PHP) in /usr/www/domainlistings/phpmyd/index.php on line 6</li>
  <li>Warning: Use of undefined constant ADDON_BLOG - assumed 'ADDON_BLOG'
  (this will throw an Error in a future version of PHP) in
  /usr/www/domainlistings/phpmyd/cp/template/default/admin_header.tpl
  on line 134</li>
  <li>Warning: Use of undefined constant ADDON_LINK_CHECKER - assumed
  'ADDON_LINK_CHECKER' (this will throw an Error in a future version of
  PHP) in
  /usr/www/domainlistings/phpmyd/cp/template/default/admin_header.tpl
  on line 179</li>
  </ul>
  
  <p>Those errors did NOT appear, and those things worked perfectly well until I changed 
  <code>if (sizeof($this-&gt;config) &lt; 1) {</code>  </p>
  
  <p>How is this linked? I'm not sure what is happening here, how that one line can make or break these other (seemingly irrelevant) things. Full code of inital problem (line 236):</p>
  
  <pre><code>/**
       * Get a configuration value
       * @param string $key
       * @return mixed
       */
      public function getConfig($key) {
          if (sizeof($this-&gt;config) &lt; 1) {
              $this-&gt;loadConfig();
          }
          return isset($this-&gt;config[$key]) ? $this-&gt;config[$key] : false;
      }
  </code></pre>
  
  <p>Any ideas?</p>