1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00
Files
archived-php-src/Zend/tests/bug79792.phpt
Nikita Popov 64931fd3c4 Fixed bug #79792
We need to remove the iterators even if the array is empty (we
will not create one if the first place, but the array may become
empty after the fact).
2020-07-07 11:58:25 +02:00

17 lines
315 B
PHP

--TEST--
Bug #79792: HT iterators not removed if empty array is destroyed
--FILE--
<?php
$a = [42];
foreach ($a as &$c) {
// Make the array empty.
unset($a[0]);
// Destroy the array.
$a = null;
}
?>
===DONE===
--EXPECTF--
Warning: Invalid argument supplied for foreach() in %s on line %d
===DONE===