1--TEST--
2Check that reference detection works properly
3--FILE--
4<?php
5
6$v00 = $v01 = $v32 = $v33 = 0;
7test(p32: $v32, p33: $v33, p00: $v00, p01: $v01);
8echo "$v00 $v01 $v32 $v33\n";
9
10$v = [0 => 0, 1 => 0, 32 => 0, 33 => 0];
11test(p32: $v[32], p33: $v[33], p00: $v[0], p01: $v[1]);
12echo "$v[0] $v[1] $v[32] $v[33]\n";
13
14function test(
15    &$p00 = null, $p01 = null, &$p02 = null, $p03 = null, &$p04 = null, $p05 = null,
16    &$p06 = null, $p07 = null, &$p08 = null, $p09 = null, &$p10 = null, $p11 = null,
17    &$p12 = null, $p13 = null, &$p14 = null, $p15 = null, &$p16 = null, $p17 = null,
18    &$p18 = null, $p19 = null, &$p20 = null, $p21 = null, &$p22 = null, $p23 = null,
19    &$p24 = null, $p25 = null, &$p26 = null, $p27 = null, &$p28 = null, $p29 = null,
20    &$p30 = null, $p31 = null, &$p32 = null, $p33 = null, &$p34 = null, $p35 = null
21) {
22    $p00++;
23    $p32++;
24}
25
26$v00 = $v01 = $v32 = $v33 = 0;
27test(p32: $v32, p33: $v33, p00: $v00, p01: $v01);
28echo "$v00 $v01 $v32 $v33\n";
29
30$v = [0 => 0, 1 => 0, 32 => 0, 33 => 0];
31test(p32: $v[32], p33: $v[33], p00: $v[0], p01: $v[1]);
32echo "$v[0] $v[1] $v[32] $v[33]\n";
33
34?>
35--EXPECT--
361 0 1 0
371 0 1 0
381 0 1 0
391 0 1 0
40