diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index c7f4d759c18..f4c3d030ba9 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2326,10 +2326,7 @@ send_by_ref: } } #if SUPPORT_INTERACTIVE - ALLOC_ZVAL(*(EG(return_value_ptr_ptr))); - **EG(return_value_ptr_ptr) = *retval_ptr; - (*EG(return_value_ptr_ptr))->refcount = 1; - (*EG(return_value_ptr_ptr))->is_ref = 0; + ALLOC_INIT_ZVAL(*(EG(return_value_ptr_ptr))); op_array->last_executed_op_number = opline-op_array->opcodes; EG(in_execution) = original_in_execution; free_alloca(Ts); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index fc17c591bd4..98344991959 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -540,6 +540,7 @@ void execute_new_code(CLS_D) CG(active_op_array)->end_op_number = CG(active_op_array)->last; EG(active_op_array) = CG(active_op_array); zend_execute(CG(active_op_array) ELS_CC); + zval_ptr_dtor(EG(return_value_ptr_ptr)); CG(active_op_array)->start_op_number = CG(active_op_array)->last_executed_op_number; } #endif