Index: /trunk/ChangeLog
===================================================================
--- /trunk/ChangeLog	(revision 1177)
+++ /trunk/ChangeLog	(revision 1178)
@@ -3,5 +3,5 @@
 ========
  * fixed #290: workaround phpize vs fbsd make bug again
- * improve compatibility with "the ionCube PHP Loader", but still broken
+ * improve compatibility with "the ionCube PHP Loader", Zend Optimizer
 
 3.0.0 2012-10-29
Index: /trunk/NEWS
===================================================================
--- /trunk/NEWS	(revision 1177)
+++ /trunk/NEWS	(revision 1178)
@@ -3,4 +3,5 @@
 ========
  * bug fixes
+ * improve compatibility with "the ionCube PHP Loader", Zend Optimizer
 
 3.0.0 2012-10-29
Index: /trunk/mod_cacher/xc_cacher.c
===================================================================
--- /trunk/mod_cacher/xc_cacher.c	(revision 1177)
+++ /trunk/mod_cacher/xc_cacher.c	(revision 1178)
@@ -1946,5 +1946,4 @@
 	memset(&compiler->new_php.op_array_info, 0, sizeof(compiler->new_php.op_array_info));
 
-	XG(initial_compile_file_called) = 0;
 	zend_try {
 		compiler->new_php.op_array = NULL;
Index: /trunk/xcache/xc_sandbox.c
===================================================================
--- /trunk/xcache/xc_sandbox.c	(revision 1177)
+++ /trunk/xcache/xc_sandbox.c	(revision 1178)
@@ -230,4 +230,5 @@
 
 	XG(sandbox) = (void *) sandbox;
+	XG(initial_compile_file_called) = 0;
 	return sandbox;
 }
@@ -291,11 +292,14 @@
 #endif
 
+	/* CG(compiler_options) applies only if initial_compile_file_called */
+	if (XG(initial_compile_file_called)) {
 #ifdef ZEND_COMPILE_DELAYED_BINDING
-	zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC);
+		zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC);
 #else
-	xc_undo_pass_two(CG(active_op_array) TSRMLS_CC);
-	xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC);
-	xc_redo_pass_two(CG(active_op_array) TSRMLS_CC);
-#endif
+		xc_undo_pass_two(CG(active_op_array) TSRMLS_CC);
+		xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC);
+		xc_redo_pass_two(CG(active_op_array) TSRMLS_CC);
+#endif
+	}
 
 #ifdef XCACHE_ERROR_CACHING
Index: /trunk/xcache_globals.h
===================================================================
--- /trunk/xcache_globals.h	(revision 1177)
+++ /trunk/xcache_globals.h	(revision 1178)
@@ -2,5 +2,5 @@
 
 ZEND_BEGIN_MODULE_GLOBALS(xcache)
-	zend_bool initial_compile_file_called; /* true is origin_compile_file is called */
+	zend_bool initial_compile_file_called; /* true if origin_compile_file is called */
 	zend_bool cacher;      /* true if enabled */
 	zend_bool stat;
