summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 8dcaf29cdc..1d461ddaa7 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -6239,7 +6239,9 @@ void zend_do_indirect_references(znode *result, const znode *num_references, zno
if (CG(active_op_array)->scope && CG(active_op_array)->this_var == -1) {
zend_string *key = STR_INIT("this", sizeof("this")-1, 0);
CG(active_op_array)->this_var = lookup_cv(CG(active_op_array), key TSRMLS_CC);
- STR_RELEASE(key);
+ if (CG(active_op_array)->vars[EX_VAR_TO_NUM(CG(active_op_array)->this_var)] != key) {
+ STR_RELEASE(key);
+ }
}
}
/* }}} */