summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-03-01 16:22:29 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-03-01 16:22:29 +0100
commit5875bf754ed4fc64a6f0b7d62734d2a816c51017 (patch)
tree1e7efbdbf66aa784515d44a35b334c3c3084fc4a /Zend/tests
parent2c182a77f773d4ebc64324d6fca7b0c91b8c6aeb (diff)
parent2c508c4d407e98a27ed2631ae88e2e10ee430003 (diff)
downloadphp-git-5875bf754ed4fc64a6f0b7d62734d2a816c51017.tar.gz
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4: Always remove HT iterators, even for uninit HT
Diffstat (limited to 'Zend/tests')
-rw-r--r--Zend/tests/array_splice_empty_ht_iter_removal.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/Zend/tests/array_splice_empty_ht_iter_removal.phpt b/Zend/tests/array_splice_empty_ht_iter_removal.phpt
new file mode 100644
index 0000000000..1461827bc9
--- /dev/null
+++ b/Zend/tests/array_splice_empty_ht_iter_removal.phpt
@@ -0,0 +1,15 @@
+--TEST--
+HT iterator should be destroyed if array becomes empty during array_splice
+--FILE--
+<?php
+$a=[4];
+$i = 0;
+foreach ($a as &$r) {
+ var_dump($r);
+ $a = array_splice($a, 0);
+ if (++$i == 2) break;
+}
+?>
+--EXPECT--
+int(4)
+int(4)