mirror of
https://github.com/php/php-src.git
synced 2026-04-10 17:43:13 +02:00
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).
17 lines
315 B
PHP
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===
|