From: Stanislav Malyshev Date: Thu, 11 Sep 2003 17:04:26 +0000 (+0000) Subject: Use scope from method, not from object X-Git-Tag: RELEASE_0_7~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=406ff728f13ebfb5f9ac6fb4727de758c4a3b98a;p=php Use scope from method, not from object --- diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f629ee7704..31d4aee2c6 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -718,8 +718,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS EX(prev_execute_data) = EG(current_execute_data); EG(current_execute_data) = &execute_data; + if (EX(function_state).function->type == ZEND_USER_FUNCTION) { calling_symbol_table = EG(active_symbol_table); + EG(scope) = EX(function_state).function->common.scope; if (fci->symbol_table) { EG(active_symbol_table) = fci->symbol_table; } else { @@ -751,6 +753,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS EG(binary_op) = orig_binary_op; } else { ALLOC_INIT_ZVAL(*fci->retval_ptr_ptr); + if(EX(function_state).function->common.scope) { + EG(scope) = EX(function_state).function->common.scope; + } ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, (fci->object_pp?*fci->object_pp:NULL), 1 TSRMLS_CC); INIT_PZVAL(*fci->retval_ptr_ptr); }