From: Felipe Pena Date: Wed, 15 Jul 2009 01:08:15 +0000 (+0000) Subject: - Fixed bug #48899 (is_callable returns true even if method does not exist in parent... X-Git-Tag: php-5.4.0alpha1~191^2~3111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd6e75c230f921cf741eb02773fd90ac75237426;p=php - Fixed bug #48899 (is_callable returns true even if method does not exist in parent class) --- diff --git a/Zend/tests/bug48899.phpt b/Zend/tests/bug48899.phpt new file mode 100644 index 0000000000..ff640543cb --- /dev/null +++ b/Zend/tests/bug48899.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #48899 (is_callable returns true even if method does not exist in parent class) +--FILE-- +testIsCallable(); +$child->testIsCallable2(); + +?> +--EXPECT-- +bool(false) +bool(true) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 73f44be652..c147601b1d 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2907,7 +2907,7 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca } } else { get_function_via_handler: - if (fcc->object_ptr) { + if (fcc->object_ptr && fcc->calling_scope == ce_org) { if (Z_OBJ_HT_P(fcc->object_ptr)->get_method) { zstr method = mname; int method_len = mlen;