title: What does the error "PHP Fatal error: cannot call overloaded function for non-object" means?
body: <p>I have WordPress website running on a GoDaddy Linux host. The error <code>PHP Fatal error: Cannot call overloaded function for non-object in wp-includes/class-wp.php on line 529</code> is being happening at random, usually in response to a POST request, I think.</p>
  
  <ul>
  <li>WordPress version: 3.8</li>
  <li>PHP version: 5.4.23</li>
  </ul>
  
  <p>Line 529 of file <code>wp-includes/class-wp.php</code> is the body of the following function in class WP:</p>
  
  <pre><code>function init() {
      wp_get_current_user();
  }
  </code></pre>
  
  <p>The error seems to be somehow related to the presence of the <a href="http://wordpress.org/extend/plugins/woocommerce/" rel="nofollow noreferrer">WooCommerce plugin</a>. I haven't seen the error when the plugin is deactivated. </p>
  
  <p>Unfortunately, removing WooCommerce is not an option so I need to discover how is the error being triggered and provide a solution. The problem is I don't know what to look for.</p>
  
  <p><strong>I want to understand what causes an error like the one above in a general case.</strong></p>
  
  <ul>
  <li>Can anyone provide an example of PHP code that generates such an error? or</li>
  <li>an explanation of why it happens?</li>
  </ul>
  
  <p><strong>I'm hoping to be able to use that information to find a similar problem in WooCommerce's source code.</strong></p>
  
  <p>I took a quick look at PHP's interpreter source code (<a href="https://github.com/php/php-src/blob/44dcdd146d36c91dddc9b89b4679074fdbf2e183/Zend/zend_vm_def.h#L2030" rel="nofollow noreferrer">here</a> and <a href="https://github.com/php/php-src/blob/af6c11c5f060870d052a2b765dc634d9e47d0f18/Zend/zend_execute_API.c#L996" rel="nofollow noreferrer">here</a>) and found the line that generates the error message, but to be honest, that didn't help me.</p>
  
  <p>A <a href="https://stackoverflow.com/questions/15505901/php-fatal-error-cannot-call-overloaded-function-for-non-object">question in SO</a> about the same error in a different application has an answer indicating the problem was caused by server overload. I don't think that's the case here. We don't get too much traffic.</p>
  
  <p>A <a href="https://wordpress.stackexchange.com/questions/44016/php-fatal-error-cannot-call-overloaded-function-for-non-object-in-wp-includes-c">different question in WordPress SE</a> offers two possible causes. Either the problem is associated with Alternate PHP Cache (APC) being enabled or the problem is caused by a plugin. Unfortunately nobody offers actual solutions or specific causes.</p>
  
  <p>My case is similar to the one exposed in the question above: I have APC enabled (currently trying to get help from GoDaddy to disable it) and my tests suggest WooCommerce has some responsibility.</p>
  
  <p>I appreciate all your help.</p>