Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 970)
+++ /trunk/xcache.c	(revision 971)
@@ -2892,4 +2892,9 @@
 	}
 
+	if (Z_TYPE_P(value) == IS_OBJECT) {
+		php_error_docref(NULL TSRMLS_CC, E_ERROR, "Objects cannot be stored in the variable cache. Use serialize before xcache_set");
+		RETURN_NULL();
+	}
+
 	/* max ttl */
 	if (xc_var_maxttl && (!entry_var.entry.ttl || entry_var.entry.ttl > xc_var_maxttl)) {
