 retrieving revision 1.74
 diff -u -r1.74 zend_exceptions.c
 --- Zend/zend_exceptions.c	30 Oct 2004 10:13:27 -0000	1.74
-+++ Zend/zend_exceptions.c	14 Nov 2004 20:55:49 -0000
++++ Zend/zend_exceptions.c	14 Nov 2004 22:57:16 -0000
 @@ -28,6 +28,7 @@
  #include "zend_interfaces.h"
  #include "zend_exceptions.h"

retrieving revision 1.269
diff -u -r1.269 zend_API.c
--- Zend/zend_API.c	2 Nov 2004 13:10:37 -0000	1.269
+++ Zend/zend_API.c	14 Nov 2004 20:55:46 -0000
@@ -1313,6 +1313,9 @@
 			internal_function->return_reference = ptr->arg_info[0].return_reference;
 		} else {

+		 *   import package~ClassName;
+		 *   import $classname;
+		 * Calculate the short name from the long one
+		 *
+		 * When we're importing within a package, op2.u.constant contains
+		 * the package's name as a string - prefix alias name with it.
+		 */
+		case IS_UNUSED: {
+			if (opline->op2.u.constant.type == IS_STRING) {
+				if (!memchr(ce->name, '~', ce->name_length)) {		/* import main~RuntimeError; */
+					alias_len = opline->op2.u.constant.value.str.len + ce->name_length + 1;
+					alias_name = (char*) emalloc(alias_len + 1);
+					memcpy(alias_name, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
+					memcpy(alias_name + opline->op2.u.constant.value.str.len, "~", sizeof("~"));
+					memcpy(alias_name + opline->op2.u.constant.value.str.len + 1, ce->name, ce->name_length);
+				} else {
+					char *tmp = strrchr(ce->name, '~');
+
+					alias_len = opline->op2.u.constant.value.str.len + strlen(tmp);
+					alias_name = (char*) emalloc(alias_len + 1);
+					memcpy(alias_name, opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
+					memcpy(alias_name + opline->op2.u.constant.value.str.len, "~", sizeof("~"));
+					memcpy(alias_name + opline->op2.u.constant.value.str.len + 1, tmp+ 1, strlen(tmp) - 1);
+				}
+				alias_name[alias_len]= 0;
+				zend_str_tolower(alias_name, alias_len);
+				efree(opline->op2.u.constant.value.str.val);
+			} else {
+				char *tmp = strrchr(ce->name, '~');
+				if (!tmp) {
+					zend_error(E_COMPILE_ERROR, "Cannot import %s which is not contained in a package", ce->name);
+					/* Bails out */
+				}
+
+				alias_len = strlen(tmp)- 1;		
+				alias_name = zend_str_tolower_dup(tmp+ 1, alias_len);
+			}
