xref: /PHP-8.1/Zend/tests/bug71030.phpt (revision d0a56f70)
1--TEST--
2Bug #71030: Self-assignment in list() may have inconsistent behavior
3--FILE--
4<?php
5
6function test1() {
7    $a = [1, 2];
8    $c =& $a;
9    list($c, $b) = $a;
10    var_dump($a, $b);
11}
12
13function test2() {
14    $a = [1, 2];
15    $_a = "a";
16    list($$_a, $b) = $a;
17    var_dump($a, $b);
18}
19
20test1();
21test2();
22
23?>
24--EXPECT--
25int(1)
26int(2)
27int(1)
28int(2)
29