 retrieving revision 1.202
 diff -u -r1.202 zend_operators.c
 --- Zend/zend_operators.c	3 Nov 2004 23:13:32 -0000	1.202
-+++ Zend/zend_operators.c	14 Nov 2004 20:46:59 -0000
++++ Zend/zend_operators.c	14 Nov 2004 20:55:52 -0000
 @@ -102,6 +102,55 @@
  	return result;
  }

 static int ZEND_ADD_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 {
 	zend_op *opline = EX(opline);
@@ -10338,6 +10554,18 @@
 	return zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(1, ZEND_OPCODE_HANDLER_ARGS_PASSTHRU);
 }
 

+		if (*pce == ce) {
+			goto done;
+		}
+		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 */
+	}
+
