RSS
 

Trying to clone an uncloneable object of class stdClass

20 Jun

Ran into the following error recently:

PHP Fatal error: Trying to clone an uncloneable object of class stdClass in /wp-includes/cache.php

Adding the following to the PHP config fixed the error

; Adding for wp-e-commerce plugin
zend.ze1_compatibility_mode = Off

The ze1_compatiblity_mode is removed in PHP 5.3 so in that case I needed to wrap the clone calls with

function clone_it($data)
{
if(get_class($data) != ‘stdClass’)
return clone $data;
else
return unserialize(serialize($data));
}

 
 

Leave a Reply

 

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Anti-spam image