Index: /trunk/ChangeLog
===================================================================
--- /trunk/ChangeLog	(revision 495)
+++ /trunk/ChangeLog	(revision 496)
@@ -6,4 +6,5 @@
 ChangeLog
 ========
+ * compiler errors: all compiler warning (e.g.: E_STRICT) is now cached and is supported for user handler
  * added module dependency
  * live with wrong system time: allow caching files with mtime in further
Index: /trunk/processor/processor.m4
===================================================================
--- /trunk/processor/processor.m4	(revision 495)
+++ /trunk/processor/processor.m4	(revision 496)
@@ -741,4 +741,13 @@
 dnl }}}
 #endif
+#ifdef E_STRICT
+DEF_STRUCT_P_FUNC(`xc_compilererror_t', , `dnl {{{
+	DISPATCH(int, type)
+	DISPATCH(uint, lineno)
+	DISPATCH(int, error_len)
+	PROC_STRING_L(error, error_len)
+')
+dnl }}}
+#endif
 DEF_STRUCT_P_FUNC(`xc_entry_data_php_t', , `dnl {{{
 	zend_uint i;
@@ -790,4 +799,12 @@
 	')
 #endif
+#ifdef E_STRICT
+	DISPATCH(zend_uint, compilererror_cnt)
+	IFRESTORE(`
+		COPY(compilererrors)
+	', `
+		STRUCT_ARRAY(compilererror_cnt, xc_compilererror_t, compilererrors)
+	')
+#endif
 	DISPATCH(zend_bool, have_early_binding)
 	DISPATCH(zend_bool, have_references)
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 495)
+++ /trunk/utils.c	(revision 496)
@@ -517,4 +517,30 @@
 #define OG(x) (sandbox->orig_##x)
 /* }}} */
+#ifdef E_STRICT
+static void xc_sandbox_error_cb(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args) /* {{{ */
+{
+	xc_compilererror_t *compilererror;
+	xc_sandbox_t *sandbox;
+	TSRMLS_FETCH();
+
+	sandbox = (xc_sandbox_t *) XG(sandbox);
+	assert(sandbox != NULL);
+	if (sandbox->compilererror_cnt <= sandbox->compilererror_size) {
+		if (sandbox->compilererror_size) {
+			sandbox->compilererror_size += 16;
+			sandbox->compilererrors = erealloc(sandbox->compilererrors, sandbox->compilererror_size * sizeof(sandbox->compilererrors));
+		}
+		else {
+			sandbox->compilererror_size = 16;
+			sandbox->compilererrors = emalloc(sandbox->compilererror_size * sizeof(sandbox->compilererrors));
+		}
+	}
+	compilererror = &sandbox->compilererrors[sandbox->compilererror_cnt++];
+	compilererror->type   = type;
+	compilererror->lineno = error_lineno;
+	compilererror->error_len = zend_vspprintf(&compilererror->error, 0, format, args);
+}
+/* }}} */
+#endif
 #ifdef ZEND_ENGINE_2_1
 static zend_bool xc_auto_global_callback(char *name, uint name_len TSRMLS_DC) /* {{{ */
@@ -622,7 +648,13 @@
 #ifdef E_STRICT
 	sandbox->orig_user_error_handler_error_reporting = EG(user_error_handler_error_reporting);
-	EG(user_error_handler_error_reporting) &= ~E_STRICT;
-#endif
-
+	EG(user_error_handler_error_reporting) = 0;
+
+	sandbox->compilererror_cnt  = 0;
+	sandbox->compilererror_size = 0;
+	sandbox->orig_zend_error_cb = zend_error_cb;
+	zend_error_cb = xc_sandbox_error_cb;
+#endif
+
+	XG(sandbox) = (void *) sandbox;
 	return sandbox;
 }
@@ -684,4 +716,14 @@
 	}
 
+#ifdef E_STRICT
+	/* restore trigger errors */
+	for (i = 0; i < sandbox->compilererror_cnt; i ++) {
+		xc_compilererror_t *error = &sandbox->compilererrors[i];
+		CG(zend_lineno) = error->lineno;
+		zend_error(error->type, "%s", error->error);
+	}
+	CG(zend_lineno) = 0;
+#endif
+
 	i = 1;
 	zend_hash_add(&OG(included_files), sandbox->filename, strlen(sandbox->filename) + 1, (void *)&i, sizeof(int), NULL);
@@ -690,4 +732,10 @@
 void xc_sandbox_free(xc_sandbox_t *sandbox, xc_install_action_t install TSRMLS_DC) /* {{{ */
 {
+	XG(sandbox) = NULL;
+#ifdef E_STRICT
+	EG(user_error_handler_error_reporting) = sandbox->orig_user_error_handler_error_reporting;
+	zend_error_cb = sandbox->orig_zend_error_cb;
+#endif
+
 	/* restore first first install function/class */
 #ifdef HAVE_XCACHE_CONSTANT
@@ -731,8 +779,11 @@
 	memcpy(&EG(included_files), &OG(included_files), sizeof(EG(included_files)));
 
-#ifdef E_STRICT
-	EG(user_error_handler_error_reporting) = sandbox->orig_user_error_handler_error_reporting;
-#endif
-
+	if (sandbox->compilererrors) {
+		int i;
+		for (i = 0; i < sandbox->compilererror_cnt; i ++) {
+			efree(sandbox->compilererrors[i].error);
+		}
+		efree(sandbox->compilererrors);
+	}
 	if (sandbox->alloc) {
 		efree(sandbox);
Index: /trunk/utils.h
===================================================================
--- /trunk/utils.h	(revision 495)
+++ /trunk/utils.h	(revision 496)
@@ -80,5 +80,4 @@
 typedef struct {
 	int alloc;
-	int orig_user_error_handler_error_reporting;
 	char *filename;
 
@@ -98,4 +97,12 @@
 	Bucket    *tmp_internal_function_tail;
 	Bucket    *tmp_internal_class_tail;
+
+#ifdef E_STRICT
+	int orig_user_error_handler_error_reporting;
+	ZEND_API void (*orig_zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const char *format, va_list args);
+	zend_uint compilererror_cnt;
+	zend_uint compilererror_size;
+	xc_compilererror_t *compilererrors;
+#endif
 } xc_sandbox_t;
 
Index: /trunk/xcache-test.ini
===================================================================
--- /trunk/xcache-test.ini	(revision 495)
+++ /trunk/xcache-test.ini	(revision 496)
@@ -1,2 +1,3 @@
+display_error = On
 auto_globals_jit = Off
 
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 495)
+++ /trunk/xcache.c	(revision 496)
@@ -664,4 +664,13 @@
 		zend_u_is_auto_global(aginfo->type, aginfo->key, aginfo->key_len TSRMLS_CC);
 	}
+#endif
+#ifdef E_STRICT
+	/* restore trigger errors */
+	for (i = 0; i < p->compilererror_cnt; i ++) {
+		xc_compilererror_t *error = &p->compilererrors[i];
+		CG(zend_lineno) = error->lineno;
+		zend_error(error->type, "%s", error->error);
+	}
+	CG(zend_lineno) = 0;
 #endif
 
@@ -1115,4 +1124,8 @@
 	}
 	/* }}} */
+#ifdef E_STRICT
+	php->compilererrors = ((xc_sandbox_t *) XG(sandbox))->compilererrors;
+	php->compilererror_cnt = ((xc_sandbox_t *) XG(sandbox))->compilererror_cnt;
+#endif
 	/* {{{ find inherited classes that should be early-binding */
 	php->have_early_binding = 0;
Index: /trunk/xcache.h
===================================================================
--- /trunk/xcache.h	(revision 495)
+++ /trunk/xcache.h	(revision 496)
@@ -266,4 +266,12 @@
 typedef enum { XC_TYPE_PHP, XC_TYPE_VAR } xc_entry_type_t;
 typedef char xc_md5sum_t[16];
+/* {{{ xc_compilererror_t */
+typedef struct {
+	int type;
+	uint lineno;
+	int error_len;
+	char *error;
+} xc_compilererror_t;
+/* }}} */
 /* {{{ xc_entry_data_php_t */
 struct _xc_entry_data_php_t {
@@ -296,4 +304,9 @@
 	zend_uint autoglobal_cnt;
 	xc_autoglobal_t *autoglobals;
+#endif
+
+#ifdef E_STRICT
+	zend_uint compilererror_cnt;
+	xc_compilererror_t *compilererrors;
 #endif
 
Index: /trunk/xcache_globals.h
===================================================================
--- /trunk/xcache_globals.h	(revision 495)
+++ /trunk/xcache_globals.h	(revision 496)
@@ -21,4 +21,6 @@
 	HashTable internal_class_table;
 	zend_bool internal_table_copied;
+
+	void *sandbox;
 ZEND_END_MODULE_GLOBALS(xcache)
 
