summaryrefslogtreecommitdiff
path: root/Zend/zend_interfaces.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_interfaces.c')
-rw-r--r--Zend/zend_interfaces.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index ded81e2918..d5420dae76 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -90,11 +90,12 @@ ZEND_API zval* zend_call_method(zval *object, zend_class_entry *obj_ce, zend_fun
if (object) {
fcic.called_scope = Z_OBJCE_P(object);
} else if (obj_ce &&
- !(EG(called_scope) &&
- instanceof_function(EG(called_scope), obj_ce TSRMLS_CC))) {
+ !(EG(current_execute_data) &&
+ EG(current_execute_data)->called_scope &&
+ instanceof_function(EG(current_execute_data)->called_scope, obj_ce TSRMLS_CC))) {
fcic.called_scope = obj_ce;
} else {
- fcic.called_scope = EG(called_scope);
+ fcic.called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
}
fcic.object = object ? Z_OBJ_P(object) : NULL;
result = zend_call_function(&fci, &fcic TSRMLS_CC);