]> granicus.if.org Git - php/commitdiff
Use scope from method, not from object
authorStanislav Malyshev <stas@php.net>
Thu, 11 Sep 2003 17:04:26 +0000 (17:04 +0000)
committerStanislav Malyshev <stas@php.net>
Thu, 11 Sep 2003 17:04:26 +0000 (17:04 +0000)
Zend/zend_execute_API.c

index f629ee770430e75a066c92c83ffb1461fb416720..31d4aee2c68c1e2ecf22a2edde2ac1a35102bf65 100644 (file)
@@ -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);
        }