1--TEST--
2The SensitiveParameter attribute does not suppress superfluous arguments if the last parameter is sensitive.
3--FILE--
4<?php
5
6function test(
7    $non_sensitive,
8    #[SensitiveParameter] $sensitive,
9)
10{
11    debug_print_backtrace();
12    var_dump(debug_backtrace());
13    var_dump((new Exception)->getTrace());
14}
15
16test('foo', 'bar', 'baz');
17
18?>
19--EXPECTF--
20#0 %ssensitive_parameter_extra_arguments.php(13): test('foo', Object(SensitiveParameterValue), 'baz')
21array(1) {
22  [0]=>
23  array(4) {
24    ["file"]=>
25    string(%d) "%ssensitive_parameter_extra_arguments.php"
26    ["line"]=>
27    int(13)
28    ["function"]=>
29    string(4) "test"
30    ["args"]=>
31    array(3) {
32      [0]=>
33      string(3) "foo"
34      [1]=>
35      object(SensitiveParameterValue)#%d (0) {
36      }
37      [2]=>
38      string(3) "baz"
39    }
40  }
41}
42array(1) {
43  [0]=>
44  array(4) {
45    ["file"]=>
46    string(%d) "%ssensitive_parameter_extra_arguments.php"
47    ["line"]=>
48    int(13)
49    ["function"]=>
50    string(4) "test"
51    ["args"]=>
52    array(3) {
53      [0]=>
54      string(3) "foo"
55      [1]=>
56      object(SensitiveParameterValue)#%d (0) {
57      }
58      [2]=>
59      string(3) "baz"
60    }
61  }
62}
63