Index: Zend/zend_compile.c =================================================================== RCS file: /repository/ZendEngine2/zend_compile.c,v retrieving revision 1.647.2.27.2.9 diff -u -p -d -r1.647.2.27.2.9 zend_compile.c --- Zend/zend_compile.c 30 May 2006 23:10:28 -0000 1.647.2.27.2.9 +++ Zend/zend_compile.c 6 Jun 2006 09:40:36 -0000 @@ -2247,6 +2247,17 @@ static zend_bool do_inherit_constant_che ZEND_API void zend_do_implement_interface(zend_class_entry *ce, zend_class_entry *iface TSRMLS_DC) { + zend_uint i, if_num = ce->num_interfaces, cnt = 0; + + for (i = 0; i < if_num; i++) { + if (ce->interfaces[i] != NULL && !strcmp(ce->interfaces[i]->name, iface->name)) { + cnt++; + if (cnt > 1) { + zend_error(E_COMPILE_ERROR, "Cannot implement previously implemented interface %s", iface->name); + } + } + } + zend_hash_merge_ex(&ce->constants_table, &iface->constants_table, (copy_ctor_func_t) zval_add_ref, sizeof(zval *), (merge_checker_func_t) do_inherit_constant_check, iface); zend_hash_merge_ex(&ce->function_table, &iface->function_table, (copy_ctor_func_t) do_inherit_method, sizeof(zend_function), (merge_checker_func_t) do_inherit_method_check, ce);