]> granicus.if.org Git - php/commitdiff
Remove called_scope inheritance in zend_call_method()
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Jun 2020 08:03:43 +0000 (10:03 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 10 Jun 2020 08:04:37 +0000 (10:04 +0200)
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.

Zend/zend_interfaces.c

index 2a6d70dc581e5cf335f1afad56fc591836280897..52d3a8ee19e379570e272956c9f73d0ad45f8340 100644 (file)
@@ -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);