summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-06-10 10:03:43 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-06-10 10:04:37 +0200
commitc23edd2acfb30ddfeddedec7198e284a287657eb (patch)
treeafe4c8690cf370b1ae841caa3a7284bb0489c0c1
parent097043db2a0d113f89bd26c6f1d7a976d83951a8 (diff)
downloadphp-git-c23edd2acfb30ddfeddedec7198e284a287657eb.tar.gz
Remove called_scope inheritance in zend_call_method()
Similar to 097043db2a0d113f89bd26c6f1d7a976d83951a8, but for the zend_call_method() API. I don't think we ever use this for static methods, but this logic shouldn't be there. If you want to inherit the active LSB scope for some reason, do so explicitly.
-rw-r--r--Zend/zend_interfaces.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 2a6d70dc58..52d3a8ee19 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -73,12 +73,7 @@ ZEND_API zval* zend_call_method(zend_object *object, zend_class_entry *obj_ce, z
if (object) {
called_scope = object->ce;
} else {
- called_scope = zend_get_called_scope(EG(current_execute_data));
- if (obj_ce &&
- (!called_scope ||
- !instanceof_function(called_scope, obj_ce))) {
- called_scope = obj_ce;
- }
+ called_scope = obj_ce;
}
zend_call_known_function(fn, object, called_scope, retval_ptr, param_count, params);