diff options
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r-- | Zend/zend_API.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a1b9083629..3a96574fcc 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2806,8 +2806,13 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache ret = 1; } } else if ((ce = zend_lookup_class_ex(name, NULL, 1 TSRMLS_CC)) != NULL) { - zend_class_entry *scope = EG(active_op_array) ? EG(active_op_array)->scope : NULL; + zend_class_entry *scope; + zend_execute_data *ex = EG(current_execute_data); + while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) { + ex = ex->prev_execute_data; + } + scope = ex ? ex->func->common.scope : NULL; fcc->calling_scope = ce; if (scope && !fcc->object && Z_OBJ(EG(This)) && instanceof_function(Z_OBJCE(EG(This)), scope TSRMLS_CC) && |