]> granicus.if.org Git - php/commitdiff
- Fix handling of abstract methods. They must be inherited when inheriting
authorMarcus Boerger <helly@php.net>
Mon, 26 May 2003 22:06:49 +0000 (22:06 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 26 May 2003 22:06:49 +0000 (22:06 +0000)
  a method.
- Fix entry more (should be amed has_more).
- Add a check against that bug.

ext/spl/php_spl.c
ext/spl/spl_functions.c
ext/spl/tests/forward.phpt

index a60c504d3379fd9230baaeefe86ad79c3f560e6b..4467b0aa60b8d1ecca7e3c0bee315fad94b75629 100755 (executable)
@@ -131,7 +131,7 @@ PHP_MINIT_FUNCTION(spl)
        REGISTER_SPL_INTERFACE(spl, forward);
        REGISTER_SPL_INTF_FUNC(spl, forward, current);
        REGISTER_SPL_INTF_FUNC(spl, forward, next);
-       REGISTER_SPL_INTF_FUNC(spl, forward, more);
+       REGISTER_SPL_INTF_FUNC(spl, forward, has_more);
 
        REGISTER_SPL_INTERFACE(spl, sequence);
        REGISTER_SPL_INTF_FUNC(spl, sequence, rewind);
index 70da239906b4102b3f6dad5d8027a917677610e0..c8a98a0cbba1b78f391dd8b96ed1c0b6c842318d 100755 (executable)
@@ -106,6 +106,7 @@ void spl_register_implement(zend_class_entry * class_entry, zend_class_entry * i
        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));
 }
 /* }}} */
 
index 2c8a584b8a8b4b0f119e26ddea0decc65df3b082..37d22519483604b5323cf6c85148bb85c8d5523f 100755 (executable)
@@ -36,6 +36,13 @@ $i = new c();
 
 $c_info = array(class_name($i) => array('inheits' => class_parents($i), 'implements' => class_implements($i)));
 print_r($c_info);
+$methods = get_class_methods("spl::forward_assoc");
+sort($methods);
+print_r($methods);
+$methods = get_class_methods($i);
+sort($methods);
+print_r($methods);
+
 
 echo "1st try\n";
 foreach($i as $w) {
@@ -76,6 +83,20 @@ Array
         )
 
 )
+Array
+(
+    [0] => current
+    [1] => has_more
+    [2] => key
+    [3] => next
+)
+Array
+(
+    [0] => current
+    [1] => has_more
+    [2] => key
+    [3] => next
+)
 1st try
 c::has_more
 c::current