summaryrefslogtreecommitdiff
path: root/Zend/tests
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-03-01 16:22:51 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-03-01 16:22:51 +0100
commit26c3fa275943e0e8bf8527b7ed1b3e68eecb72a1 (patch)
treef1bf1cd989dcca7f1605df1a2f2ec6437f54f1c9 /Zend/tests
parentb4fbf1d381d23ad3e9ad8f6df572adc1984a0a45 (diff)
parent5875bf754ed4fc64a6f0b7d62734d2a816c51017 (diff)
downloadphp-git-26c3fa275943e0e8bf8527b7ed1b3e68eecb72a1.tar.gz
Merge branch 'PHP-8.0'
* PHP-8.0: 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)