1--TEST--
2The SensitiveParameter attribute suppresses the single sensitive argument in a function called in eval().
3--FILE--
4<?php
5
6function test(#[SensitiveParameter] $sensitive)
7{
8    debug_print_backtrace();
9    var_dump(debug_backtrace());
10    var_dump((new Exception)->getTrace());
11}
12
13eval(<<<'EOT'
14test('sensitive');
15EOT);
16
17?>
18--EXPECTF--
19#0 %ssensitive_parameter_eval_call.php(11) : eval()'d code(1): test(Object(SensitiveParameterValue))
20#1 %ssensitive_parameter_eval_call.php(11): eval()
21array(2) {
22  [0]=>
23  array(4) {
24    ["file"]=>
25    string(%d) "%ssensitive_parameter_eval_call.php(11) : eval()'d code"
26    ["line"]=>
27    int(1)
28    ["function"]=>
29    string(4) "test"
30    ["args"]=>
31    array(1) {
32      [0]=>
33      object(SensitiveParameterValue)#%d (0) {
34      }
35    }
36  }
37  [1]=>
38  array(3) {
39    ["file"]=>
40    string(%d) "%ssensitive_parameter_eval_call.php"
41    ["line"]=>
42    int(11)
43    ["function"]=>
44    string(4) "eval"
45  }
46}
47array(2) {
48  [0]=>
49  array(4) {
50    ["file"]=>
51    string(%d) "%ssensitive_parameter_eval_call.php(11) : eval()'d code"
52    ["line"]=>
53    int(1)
54    ["function"]=>
55    string(4) "test"
56    ["args"]=>
57    array(1) {
58      [0]=>
59      object(SensitiveParameterValue)#%d (0) {
60      }
61    }
62  }
63  [1]=>
64  array(3) {
65    ["file"]=>
66    string(%d) "%ssensitive_parameter_eval_call.php"
67    ["line"]=>
68    int(11)
69    ["function"]=>
70    string(4) "eval"
71  }
72}
73