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