xref: /PHP-7.4/ext/standard/tests/array/bug61967.phpt (revision 11e05092)
1--TEST--
2Bug #61967: unset array item in array_walk_recursive cause inconsistent array
3--FILE--
4<?php
5$arr = array(
6    range(1, 5),
7    range(1, 5),
8    range(1, 5),
9    range(1, 5),
10    range(1, 5),
11);
12
13array_walk_recursive($arr,
14    function (&$value, $key) use(&$arr) {
15        var_dump($key);
16        unset($arr[$key]);
17    }
18);
19?>
20--EXPECT--
21int(0)
22int(1)
23int(2)
24int(3)
25int(4)
26