xref: /PHP-7.3/Zend/tests/bug73663.phpt (revision 358bd77b)
1--TEST--
2Bug #73663 ("Invalid opcode 65/16/8" occurs with a variable created with list())
3--FILE--
4<?php
5function change(&$ref) {
6	$ref = range(1, 10);
7	return;
8}
9
10$func = function (&$ref) {
11	return change($ref);
12};
13
14$array = [1];
15var_dump(list($val) = $array); // NG: Invalid opcode
16
17change(list($val) = $array);
18var_dump($array);
19
20$array = [1];
21
22$func(list($val) = $array);
23var_dump($array);
24?>
25--EXPECT--
26array(1) {
27  [0]=>
28  int(1)
29}
30array(10) {
31  [0]=>
32  int(1)
33  [1]=>
34  int(2)
35  [2]=>
36  int(3)
37  [3]=>
38  int(4)
39  [4]=>
40  int(5)
41  [5]=>
42  int(6)
43  [6]=>
44  int(7)
45  [7]=>
46  int(8)
47  [8]=>
48  int(9)
49  [9]=>
50  int(10)
51}
52array(10) {
53  [0]=>
54  int(1)
55  [1]=>
56  int(2)
57  [2]=>
58  int(3)
59  [3]=>
60  int(4)
61  [4]=>
62  int(5)
63  [5]=>
64  int(6)
65  [6]=>
66  int(7)
67  [7]=>
68  int(8)
69  [8]=>
70  int(9)
71  [9]=>
72  int(10)
73}
74