summaryrefslogtreecommitdiff
path: root/Zend/zend_closures.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_closures.c')
-rw-r--r--Zend/zend_closures.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c
index faeadd6fd7..7aaee192b7 100644
--- a/Zend/zend_closures.c
+++ b/Zend/zend_closures.c
@@ -742,7 +742,8 @@ ZEND_API void zend_create_closure(zval *res, zend_function *func, zend_class_ent
if (scope) {
closure->func.common.fn_flags |= ZEND_ACC_PUBLIC;
if (this_ptr && Z_TYPE_P(this_ptr) == IS_OBJECT && (closure->func.common.fn_flags & ZEND_ACC_STATIC) == 0) {
- ZVAL_COPY(&closure->this_ptr, this_ptr);
+ Z_ADDREF_P(this_ptr);
+ ZVAL_OBJ(&closure->this_ptr, Z_OBJ_P(this_ptr));
}
}
}