From: Marcus Boerger Date: Tue, 20 May 2003 20:20:57 +0000 (+0000) Subject: No need to copy the zval unless __clone() is called X-Git-Tag: RELEASE_1_0_2~675 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=851bd22f821cc384573fe812625ce4bc85f2892a;p=php No need to copy the zval unless __clone() is called --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f3779e3918..1f4e8130f2 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -2422,7 +2422,7 @@ int zend_init_ctor_call_handler(ZEND_OPCODE_HANDLER_ARGS) /* We are not handling overloaded classes right now */ EX(object) = get_zval_ptr(&EX(opline)->op1, EX(Ts), &EG(free_op1), BP_VAR_R); - if (!PZVAL_IS_REF(EX(object))) { + if (!PZVAL_IS_REF(EX(object)) || !EG(implicit_clone)) { EX(object)->refcount++; /* For $this pointer */ } else { zval *this_ptr;