From: Dmitry Stogov Date: Tue, 3 May 2005 12:47:27 +0000 (+0000) Subject: Fixed destruction of zval after returning from __call() X-Git-Tag: php-5.0.1b1~338 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69326a796e6e805097836d73b05424671f86c098;p=php Fixed destruction of zval after returning from __call() --- diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index dc9a1b9106..738b0bae27 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -527,7 +527,11 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) zend_call_method_with_2_params(&this_ptr, ce, &ce->__call, ZEND_CALL_FUNC_NAME, &method_result_ptr, method_name_ptr, method_args_ptr); if (method_result_ptr) { - RETVAL_ZVAL(method_result_ptr, 0, 1); + if (method_result_ptr->is_ref || method_result_ptr->refcount > 1) { + RETVAL_ZVAL(method_result_ptr, 1, 1); + } else { + RETVAL_ZVAL(method_result_ptr, 0, 1); + } } /* now destruct all auxiliaries */