-
-
Save nikic/79b9b55d325373d4b39903a82027064e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c | |
index 4511859..e41736d 100644 | |
--- a/Zend/zend_execute.c | |
+++ b/Zend/zend_execute.c | |
@@ -1635,16 +1635,9 @@ fetch_from_array: | |
zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); | |
} else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { | |
if (!Z_ISREF_P(retval)) { | |
- if (Z_REFCOUNTED_P(retval) && | |
- Z_REFCOUNT_P(retval) > 1) { | |
- if (Z_TYPE_P(retval) != IS_OBJECT) { | |
- Z_DELREF_P(retval); | |
- ZVAL_DUP(result, retval); | |
- retval = result; | |
- } else { | |
- ZVAL_COPY_VALUE(result, retval); | |
- retval = result; | |
- } | |
+ if (result != retval) { | |
+ ZVAL_COPY(result, retval); | |
+ retval = result; | |
} | |
if (Z_TYPE_P(retval) != IS_OBJECT) { | |
zend_class_entry *ce = Z_OBJCE_P(container); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment