title: PHP Cannot redeclare function/Call to undefined function
body: <p>I am using WooCommerce on Wordpress 4.7.1. Previously, I was running 4.7.0. When Wordpress automatically upgraded to 4.7.1, I suddenly began seeing checkouts fail to redirect to the "Thank you" page, and the UI showed that a fatal error had occurred.</p>
  
  <p>Turning on debugging revealed the following error:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Cannot redeclare get_cc() (previously declared in .../templates/emails/email-addresses.php:36) in .../templates/emails/email-addresses.php on line 36</p>
  </blockquote>
  
  <p>I also confirmed that this file is never directly called with <code>require</code>, <code>require_once</code>, <code>include</code>, or <code>include_once</code>. It is, however, called with <code>wc_get_template()</code>.</p>
  
  <p>A quick search brought me to <a href="https://stackoverflow.com/questions/10930646/cannot-redeclare-function-php">this similar question</a>. So I added the following to email-addresses.php:</p>
  
  <pre><code>if (!function_exists('get_cc')) {
      function get_cc( $code ) {
          ... function body
      }
  }
  </code></pre>
  
  <p>After making this change, I now receive the following error in the debug log:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Call to undefined function get_cc() in .../templates/emails/email-addresses.php on line 32</p>
  </blockquote>
  
  <p>This means that, for whatever reason, PHP believes that the function <code>get_cc</code> already exists, but at the same time it is undefined. </p>
  
  <p>I was not the original developer. I took over the project from a contractor who is not available. It does seem clear that this file is heavily modified from the original. I am certain that the value returned by the function must be kept, so I cannot just comment out the call.</p>
  
  <p><strong>Given the information above, what options do I have to either workaround or fix this issue?</strong></p>