forked from xdebug/xdebug
-
-
Notifications
You must be signed in to change notification settings - Fork 36
/
test8.phpt
145 lines (140 loc) · 3.9 KB
/
test8.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
--TEST--
Test for nested function calls
--INI--
xdebug.enable=1
xdebug.auto_trace=0
xdebug.collect_params=3
xdebug.collect_return=1
xdebug.collect_assignments=0
xdebug.auto_profile=0
xdebug.profiler_enable=0
xdebug.show_mem_delta=0
xdebug.trace_format=0
xdebug.var_display_max_depth=5
xdebug.var_display_max_children=4
xdebug.overload_var_dump=0
--FILE--
<?php
$tf = xdebug_start_trace('/tmp/'. uniqid('xdt', TRUE));
function a () {
var_dump (xdebug_get_function_stack());
return 'a';
}
function b ($b) {
return $b.'b';
}
function c ($a, $b) {
return $b.$a;
}
echo c(c(a(),b(2)), c(a(), a())), "\n";
echo file_get_contents($tf);
unlink($tf);
?>
--EXPECTF--
array(2) {
[0]=>
array(4) {
["function"]=>
string(6) "{main}"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(0)
["params"]=>
array(0) {
}
}
[1]=>
array(4) {
["function"]=>
string(1) "a"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(17)
["params"]=>
array(0) {
}
}
}
array(2) {
[0]=>
array(4) {
["function"]=>
string(6) "{main}"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(0)
["params"]=>
array(0) {
}
}
[1]=>
array(4) {
["function"]=>
string(1) "a"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(17)
["params"]=>
array(0) {
}
}
}
array(2) {
[0]=>
array(4) {
["function"]=>
string(6) "{main}"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(0)
["params"]=>
array(0) {
}
}
[1]=>
array(4) {
["function"]=>
string(1) "a"
["file"]=>
string(%d) "/%s/test8.php"
["line"]=>
int(17)
["params"]=>
array(0) {
}
}
}
aa2ba
TRACE START [%d-%d-%d %d:%d:%d]
%w%f %w%d -> a() /%s/test8.php:17
%w%f %w%d -> xdebug_get_function_stack() /%s/test8.php:5
%w%f %w%d >=> array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))
%w%f %w%d -> var_dump(array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))) /%s/test8.php:5
%w%f %w%d >=> NULL
%w%f %w%d >=> 'a'
%w%f %w%d -> b(2) /%s/test8.php:17
%w%f %w%d >=> '2b'
%w%f %w%d -> c('a', '2b') /%s/test8.php:17
%w%f %w%d >=> '2ba'
%w%f %w%d -> a() /%s/test8.php:17
%w%f %w%d -> xdebug_get_function_stack() /%s/test8.php:5
%w%f %w%d >=> array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))
%w%f %w%d -> var_dump(array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))) /%s/test8.php:5
%w%f %w%d >=> NULL
%w%f %w%d >=> 'a'
%w%f %w%d -> a() /%s/test8.php:17
%w%f %w%d -> xdebug_get_function_stack() /%s/test8.php:5
%w%f %w%d >=> array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))
%w%f %w%d -> var_dump(array (0 => array ('function' => '{main}', 'file' => '/%s/test8.php', 'line' => 0, 'params' => array ()), 1 => array ('function' => 'a', 'file' => '/%s/test8.php', 'line' => 17, 'params' => array ()))) /%s/test8.php:5
%w%f %w%d >=> NULL
%w%f %w%d >=> 'a'
%w%f %w%d -> c('a', 'a') /%s/test8.php:17
%w%f %w%d >=> 'aa'
%w%f %w%d -> c('2ba', 'aa') /%s/test8.php:17
%w%f %w%d >=> 'aa2ba'
%w%f %w%d -> file_get_contents('/tmp/%s') /%s/test8.php:19