1--TEST--
2Bug #69068: Exchanging array during array_walk -> memory errors (variation)
3--FILE--
4<?php
5
6$array = [1, 2, 3];
7$array2 = [4, 5];
8array_walk($array, function(&$value, $key) use ($array2) {
9    var_dump($value);
10    if ($value == 2) {
11        $GLOBALS['array'] = $array2;
12    }
13    $value *= 10;
14});
15var_dump($array, $array2);
16
17?>
18--EXPECT--
19int(1)
20int(2)
21int(4)
22int(5)
23array(2) {
24  [0]=>
25  int(40)
26  [1]=>
27  int(50)
28}
29array(2) {
30  [0]=>
31  int(4)
32  [1]=>
33  int(5)
34}
35