]> granicus.if.org Git - php/commitdiff
Tweak checks to detect some additional cases.
authorZeev Suraski <zeev@php.net>
Wed, 28 Jan 2004 22:27:39 +0000 (22:27 +0000)
committerZeev Suraski <zeev@php.net>
Wed, 28 Jan 2004 22:27:39 +0000 (22:27 +0000)
Reorder checks to make more sense.

Zend/zend_compile.c

index ee1afa651ca5290b4eead0aae6f59788c6d360e2..9387733f492f8430351d0ae1a1160314fc704326 100644 (file)
@@ -1733,8 +1733,8 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
                return 1; /* method doesn't exist in child, copy from parent */
        }
 
-       if (parent->common.scope != child->common.scope
-               && parent->common.fn_flags & ZEND_ACC_ABSTRACT
+       if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
+               && parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
                && child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
                zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %s::%s() (previously declared abstract in %s)", 
                        parent->common.scope->name,