 +	efree(alias_name);
 +	ZEND_VM_NEXT_OPCODE();
 +}
-+#endif
+Index: Zend/zend_vm_execute.h
+===================================================================
+RCS file: /repository/ZendEngine2/zend_vm_execute.h,v
+retrieving revision 1.2
+diff -u -r1.2 zend_vm_execute.h
+--- Zend/zend_vm_execute.h	27 Oct 2004 17:58:45 -0000	1.2
++++ Zend/zend_vm_execute.h	30 Oct 2004 12:58:07 -0000
+@@ -483,6 +483,37 @@
+ 	ZEND_VM_NEXT_OPCODE();
+ }
+ 
++static int ZEND_IMPORT_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
++{
++	zend_class_entry **pce;
++	char *alias_name;
++	int alias_len;
++	zend_op *opline = EX(opline);
++
++	if (zend_lookup_class(opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &pce TSRMLS_CC) == FAILURE) {
++		zend_error(E_COMPILE_ERROR, "Undefined class '%s' in import list", opline->op1.u.constant.value.str.val);
++		/* Bails out */
++	}
++	
++	/* Calculate the short name from the long one if no alias is supplied */
++	if (opline->op2.op_type == IS_UNUSED) {
++		char *tmp = strrchr(opline->op1.u.constant.value.str.val, '~');
++
++		alias_len = strlen(tmp)- 1;		
++		alias_name = zend_str_tolower_dup(tmp+ 1, alias_len);
++	} else {
++		alias_name = zend_str_tolower_dup(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
++		alias_len = opline->op2.u.constant.value.str.len;
++	}
++
++	if (zend_hash_add(CG(class_table), alias_name, alias_len+ 1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
++		zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", alias_name);
++		/* Bails out */
++	}
++	
++	efree(alias_name);
++	ZEND_VM_NEXT_OPCODE();
++}
+ static int ZEND_FETCH_CLASS_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
+ {
+ 	zend_op *opline = EX(opline);
+@@ -27471,6 +27502,31 @@
+   	ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
+   	ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
+   	ZEND_HANDLE_EXCEPTION_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
++  	ZEND_IMPORT_SPEC_HANDLER,
+   	ZEND_NULL_HANDLER
+   };
+   zend_opcode_handlers = (opcode_handler_t*)labels;
+@@ -30975,6 +31031,37 @@
+ 	ZEND_VM_NEXT_OPCODE();
+ }
+ 
++static int ZEND_IMPORT_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
++{
++	zend_class_entry **pce;
++	char *alias_name;
++	int alias_len;
++	zend_op *opline = EX(opline);
++
++	if (zend_lookup_class(opline->op1.u.constant.value.str.val, opline->op1.u.constant.value.str.len, &pce TSRMLS_CC) == FAILURE) {
++		zend_error(E_COMPILE_ERROR, "Undefined class '%s' in import list", opline->op1.u.constant.value.str.val);
++		/* Bails out */
++	}
++	
++	/* Calculate the short name from the long one if no alias is supplied */
++	if (opline->op2.op_type == IS_UNUSED) {
++		char *tmp = strrchr(opline->op1.u.constant.value.str.val, '~');
++
++		alias_len = strlen(tmp)- 1;		
++		alias_name = zend_str_tolower_dup(tmp+ 1, alias_len);
++	} else {
++		alias_name = zend_str_tolower_dup(opline->op2.u.constant.value.str.val, opline->op2.u.constant.value.str.len);
++		alias_len = opline->op2.u.constant.value.str.len;
++	}
++
++	if (zend_hash_add(CG(class_table), alias_name, alias_len+ 1, pce, sizeof(zend_class_entry *), NULL)==FAILURE) {
++		zend_error(E_COMPILE_ERROR, "Cannot redeclare class %s", alias_name);
++		/* Bails out */
++	}
++	
++	efree(alias_name);
++	ZEND_VM_NEXT_OPCODE();
++}
+ 
+ void zend_vm_use_old_executor()
+ {
+@@ -31129,6 +31216,7 @@
+   	ZEND_ASSIGN_DIM_HANDLER,
+   	ZEND_ISSET_ISEMPTY_PROP_OBJ_HANDLER,
+   	ZEND_HANDLE_EXCEPTION_HANDLER,
++  	ZEND_IMPORT_HANDLER,
+   	ZEND_NULL_HANDLER
+   };
+   zend_opcode_handlers = (opcode_handler_t*)labels;
+Index: Zend/zend_vm_opcodes.h
+===================================================================
+RCS file: /repository/ZendEngine2/zend_vm_opcodes.h,v
+retrieving revision 1.1
+diff -u -r1.1 zend_vm_opcodes.h
+--- Zend/zend_vm_opcodes.h	27 Oct 2004 20:13:59 -0000	1.1
++++ Zend/zend_vm_opcodes.h	30 Oct 2004 12:58:07 -0000
+@@ -127,3 +127,4 @@
+ #define ZEND_ASSIGN_DIM              147
+ #define ZEND_ISSET_ISEMPTY_PROP_OBJ  148
+ #define ZEND_HANDLE_EXCEPTION        149
++#define ZEND_IMPORT                  150

retrieving revision 1.105
diff -u -r1.105 zend_object_handlers.c
--- Zend/zend_object_handlers.c	28 Sep 2004 22:55:22 -0000	1.105
+++ Zend/zend_object_handlers.c	17 Oct 2004 18:22:10 -0000
@@ -605,6 +605,8 @@
 			call_user_call->handler = zend_std_call_user_call;
 			call_user_call->arg_info = NULL;

Index: Zend/zend_operators.c
===================================================================
RCS file: /repository/ZendEngine2/zend_operators.c,v
retrieving revision 1.201
diff -u -r1.201 zend_operators.c
--- Zend/zend_operators.c	29 Oct 2004 00:55:11 -0000	1.201
+++ Zend/zend_operators.c	30 Oct 2004 12:57:57 -0000
@@ -101,6 +101,55 @@
 	return result;
 }
