forked from open-telemetry/opentelemetry-php-instrumentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path006.phpt
53 lines (51 loc) · 722 Bytes
/
006.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
--TEST--
Check if hooks receives arguments and return value
--EXTENSIONS--
opentelemetry
--FILE--
<?php
\OpenTelemetry\Instrumentation\hook(null, 'helloWorld', fn() => var_dump(func_get_args()), fn() => var_dump(func_get_args()));
function helloWorld(string $a) {
return 42;
}
helloWorld('a');
?>
--EXPECTF--
array(6) {
[0]=>
NULL
[1]=>
array(1) {
[0]=>
string(1) "a"
}
[2]=>
NULL
[3]=>
string(10) "helloWorld"
[4]=>
string(%d) "%s/tests/006.php"
[5]=>
int(4)
}
array(8) {
[0]=>
NULL
[1]=>
array(1) {
[0]=>
string(1) "a"
}
[2]=>
int(42)
[3]=>
NULL
[4]=>
NULL
[5]=>
string(10) "helloWorld"
[6]=>
string(%d) "%s/tests/006.php"
[7]=>
int(4)
}