Remove called_scope inheritance in zend_call_method()

Similar to 097043db2a, 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.
This commit is contained in:
Nikita Popov 2020-06-10 10:03:43 +02:00
parent 097043db2a
commit c23edd2acf

View file

@ -73,13 +73,8 @@ 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;
}
}
zend_call_known_function(fn, object, called_scope, retval_ptr, param_count, params);
return retval_ptr;