Index: /trunk/coverager.c
===================================================================
--- /trunk/coverager.c	(revision 547)
+++ /trunk/coverager.c	(revision 548)
@@ -246,5 +246,9 @@
 	if (XG(coverager)) {
 		xc_coverager_enable(TSRMLS_C);
+#ifdef ZEND_COMPILE_EXTENDED_INFO
+		CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO;
+#else
 		CG(extended_info) = 1;
+#endif
 	}
 	else {
Index: /trunk/processor/processor.m4
===================================================================
--- /trunk/processor/processor.m4	(revision 547)
+++ /trunk/processor/processor.m4	(revision 548)
@@ -506,5 +506,10 @@
 	dnl main op_array && have early binding
 	zend_uint ii;
-	if (!processor->readonly_protection && !(src == processor->php_src->op_array && processor->php_src->have_early_binding)) {
+#ifdef ZEND_COMPILE_DELAYED_BINDING
+	zend_bool need_early_binding = 0;
+#else
+	zend_bool need_early_binding = processor->php_src->have_early_binding;
+#endif
+	if (!processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding)) {
 		/* really fast shallow copy */
 		memcpy(dst, src, sizeof(src[0]));
@@ -633,4 +638,7 @@
 	PROC_ZSTRING_L(, doc_comment, doc_comment_len)
 #endif
+#ifdef ZEND_COMPILE_DELAYED_BINDING
+	DISPATCH(zend_uint, early_binding);
+#endif
 
 	/* reserved */
@@ -730,5 +738,7 @@
 	STRUCT(zend_class_entry, cest)
 #endif
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 	DISPATCH(int, oplineno)
+#endif
 ')
 dnl }}}
@@ -807,5 +817,7 @@
 	')
 #endif
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 	DISPATCH(zend_bool, have_early_binding)
+#endif
 	DISPATCH(zend_bool, have_references)
 ')
Index: /trunk/utils.c
===================================================================
--- /trunk/utils.c	(revision 547)
+++ /trunk/utils.c	(revision 548)
@@ -500,7 +500,9 @@
 					ZESW(&stored_ce_ptr, NULL)
 					);
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 		if (oplineno != -1) {
 			xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC);
 		}
+#endif
 	}
 	else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h,
@@ -673,4 +675,11 @@
 #endif
 
+#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
+	sandbox->orig_compiler_options = CG(compiler_options);
+	/* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK
+	 */
+	CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING;
+#endif
+
 	XG(sandbox) = (void *) sandbox;
 	return sandbox;
@@ -728,7 +737,11 @@
 
 	if (install != XC_InstallNoBinding) {
+#ifdef ZEND_COMPILE_DELAYED_BINDING
+		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
 	}
 
@@ -805,4 +818,9 @@
 	}
 #endif
+
+#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
+	CG(compiler_options) = sandbox->orig_compiler_options;
+#endif
+
 	if (sandbox->alloc) {
 		efree(sandbox);
Index: /trunk/utils.h
===================================================================
--- /trunk/utils.h	(revision 547)
+++ /trunk/utils.h	(revision 548)
@@ -105,4 +105,8 @@
 	xc_compilererror_t *compilererrors;
 #endif
+
+#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
+	zend_uint orig_compiler_options;
+#endif
 } xc_sandbox_t;
 
Index: /trunk/xcache.c
===================================================================
--- /trunk/xcache.c	(revision 547)
+++ /trunk/xcache.c	(revision 548)
@@ -720,6 +720,11 @@
 		new_cest_ptrs[i] =
 #endif
+#ifdef ZEND_COMPILE_DELAYED_BINDING
+		xc_install_class(xce->name.str.val, &ci->cest, -1,
+				UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
+#else
 		xc_install_class(xce->name.str.val, &ci->cest, ci->oplineno,
 				UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
+#endif
 	}
 
@@ -1043,4 +1048,5 @@
 }
 /* }}} */
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 static void xc_cache_early_binding_class_cb(zend_op *opline, int oplineno, void *data TSRMLS_DC) /* {{{ */
 {
@@ -1070,4 +1076,5 @@
 }
 /* }}} */
+#endif
 static void xc_free_php(xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
 {
@@ -1238,4 +1245,5 @@
 	php->compilererror_cnt = ((xc_sandbox_t *) XG(sandbox))->compilererror_cnt;
 #endif
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 	/* {{{ find inherited classes that should be early-binding */
 	php->have_early_binding = 0;
@@ -1248,4 +1256,5 @@
 	xc_redo_pass_two(php->op_array TSRMLS_CC);
 	/* }}} */
+#endif
 
 	return op_array;
Index: /trunk/xcache.h
===================================================================
--- /trunk/xcache.h	(revision 547)
+++ /trunk/xcache.h	(revision 548)
@@ -243,5 +243,7 @@
 	ulong     h;
 	xc_cest_t cest;
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 	int       oplineno;
+#endif
 } xc_classinfo_t;
 /* }}} */
@@ -316,5 +318,7 @@
 	zend_uint classinfo_cnt;
 	xc_classinfo_t *classinfos;
+#ifndef ZEND_COMPILE_DELAYED_BINDING
 	zend_bool have_early_binding;
+#endif
 
 #ifdef ZEND_ENGINE_2_1
