]> granicus.if.org Git - php/commitdiff
For now that works.
authorMarcus Boerger <helly@php.net>
Tue, 27 May 2003 00:14:04 +0000 (00:14 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 27 May 2003 00:14:04 +0000 (00:14 +0000)
# However some of the register stuff must be moved to the engine.
# And inside the engine some fixes are needed, too.

ext/spl/spl_functions.c

index c8a98a0cbba1b78f391dd8b96ed1c0b6c842318d..9337a895b30e5c8a37fa30e232275cccd2c49e4e 100755 (executable)
@@ -100,13 +100,20 @@ void spl_register_parent_ce(zend_class_entry * class_entry, zend_class_entry * p
 }
 /* }}} */
 
+/* {{{ spl_inherit method */
+static void spl_inherit_method(zend_function *function)
+{
+       function_add_ref(function);
+}
+/* }}} */
+
 /* {{{ spl_register_implement */
 void spl_register_implement(zend_class_entry * class_entry, zend_class_entry * interface_entry TSRMLS_DC)
 {
        zend_uint num_interfaces = ++class_entry->num_interfaces;
        class_entry->interfaces = (zend_class_entry **) realloc(class_entry->interfaces, sizeof(zend_class_entry *) * num_interfaces);
        class_entry->interfaces[num_interfaces-1] = interface_entry;
-       zend_hash_copy(&class_entry->function_table, &interface_entry->function_table, NULL, NULL, sizeof(zend_function));
+       zend_hash_merge(&class_entry->function_table, &interface_entry->function_table, (copy_ctor_func_t) spl_inherit_method, NULL, sizeof(zend_function), 0);
 }
 /* }}} */