From 28e6f6a1cd0b05014de23d08f2b9b7ad235ce4c5 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Mon, 18 Dec 2023 15:52:33 +0100 Subject: [PATCH] Fix #193: Passing array item by reference breaks \DS\Set behaviour Dereference references in add_array_to_set() --- src/ds/ds_set.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ds/ds_set.c b/src/ds/ds_set.c index 3ab7b9a..e36b510 100644 --- a/src/ds/ds_set.c +++ b/src/ds/ds_set.c @@ -80,6 +80,7 @@ static inline void add_array_to_set(ds_set_t *set, HashTable *array) { zval *value; ZEND_HASH_FOREACH_VAL(array, value) { + ZVAL_DEREF(value); ds_set_add(set, value); } ZEND_HASH_FOREACH_END();