 +		if (*pce == ce) {
 +			goto done;
 +		}
-+		zend_error(
-+			E_COMPILE_ERROR, 
-+			"Cannot import class %s as class %s (declared in %s on line %d)",
-+			ce->name, 
-+			(*pce)->name,
-+			(*pce)->filename, 
-+			(*pce)->line_start
-+		);
++		if ((*pce)->type == ZEND_USER_CLASS) {
++			zend_error(E_COMPILE_ERROR, "Cannot import class %s as class %s (declared in %s on line %d)", ce->name, (*pce)->name, (*pce)->filename, (*pce)->line_start);
++		} else {
++			zend_error(E_COMPILE_ERROR, "Cannot import class %s as class %s (internally declared)", ce->name, (*pce)->name);
++		}        
 +		/* Bails out */
 +	}
 +

retrieving revision 1.109
diff -u -r1.109 zend_opcode.c
--- Zend/zend_opcode.c	4 Oct 2004 19:54:34 -0000	1.109
+++ Zend/zend_opcode.c	14 Nov 2004 20:46:58 -0000
@@ -78,6 +78,9 @@
 	op_array->doc_comment = NULL;
 	op_array->doc_comment_len = 0;

 static int zend_init_add_array_helper_SPEC_CONST_UNUSED(ZEND_OPCODE_HANDLER_ARGS)
 {
 	zend_op *opline = EX(opline);
@@ -3614,6 +3755,18 @@
 	return zend_init_add_array_helper_SPEC_CONST_CV(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 
