summaryrefslogtreecommitdiff
path: root/ext/spl/spl_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/spl_array.c')
-rw-r--r--ext/spl/spl_array.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index f1c49f4db4..a9645ec61d 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -473,10 +473,7 @@ static void spl_array_write_dimension_ex(int check_inherited, zval *object, zval
return;
}
- if (Z_REFCOUNTED_P(value)) {
- Z_ADDREF_P(value);
- }
-
+ Z_TRY_ADDREF_P(value);
if (!offset) {
ht = spl_array_get_hash_table(intern);
zend_hash_next_index_insert(ht, value);