-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathexpand_params_extend_limit.phpt
62 lines (61 loc) · 1.16 KB
/
expand_params_extend_limit.phpt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
--TEST--
Check if pre hook can expand params of function when that requires extending the stack only until hardcoded limit
--EXTENSIONS--
opentelemetry
--INI--
opentelemetry.allow_stack_extension=On
--FILE--
<?php
OpenTelemetry\Instrumentation\hook(
null,
'helloWorld',
pre: function($instance, array $params) {
return [$params[0], 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u'];
},
post: fn() => null
);
function helloWorld($a, $b) {
var_dump(func_get_args());
}
helloWorld('a');
?>
--EXPECTF--
Warning: helloWorld(): OpenTelemetry: pre hook invalid argument index 18 - exceeds built-in stack extension limit, class=null function=helloWorld in %s
array(18) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(1) "c"
[3]=>
string(1) "d"
[4]=>
string(1) "e"
[5]=>
string(1) "f"
[6]=>
string(1) "g"
[7]=>
string(1) "h"
[8]=>
string(1) "i"
[9]=>
string(1) "j"
[10]=>
string(1) "k"
[11]=>
string(1) "l"
[12]=>
string(1) "m"
[13]=>
string(1) "n"
[14]=>
string(1) "o"
[15]=>
string(1) "p"
[16]=>
string(1) "q"
[17]=>
string(1) "r"
}