xref: /PHP-8.4/Zend/tests/bug79792.phpt (revision 64931fd3)
1--TEST--
2Bug #79792: HT iterators not removed if empty array is destroyed
3--FILE--
4<?php
5$a = [42];
6foreach ($a as &$c) {
7    // Make the array empty.
8    unset($a[0]);
9    // Destroy the array.
10    $a = null;
11}
12?>
13===DONE===
14--EXPECTF--
15Warning: foreach() argument must be of type array|object, null given in %s on line %d
16===DONE===
17