1--TEST--
2debug_backtrace limit
3--FILE--
4<?php
5function a() {
6    b();
7}
8
9function b() {
10    c();
11}
12
13function c() {
14    print_r(debug_backtrace(0, 1));
15    print_r(debug_backtrace(0, 2));
16    print_r(debug_backtrace(0, 0));
17    print_r(debug_backtrace(0, 4));
18}
19
20a();
21?>
22--EXPECTF--
23Array
24(
25    [0] => Array
26        (
27            [file] => %sdebug_backtrace_limit.php
28            [line] => 7
29            [function] => c
30            [args] => Array
31                (
32                )
33
34        )
35
36)
37Array
38(
39    [0] => Array
40        (
41            [file] => %sdebug_backtrace_limit.php
42            [line] => 7
43            [function] => c
44            [args] => Array
45                (
46                )
47
48        )
49
50    [1] => Array
51        (
52            [file] => %sdebug_backtrace_limit.php
53            [line] => 3
54            [function] => b
55            [args] => Array
56                (
57                )
58
59        )
60
61)
62Array
63(
64    [0] => Array
65        (
66            [file] => %sdebug_backtrace_limit.php
67            [line] => 7
68            [function] => c
69            [args] => Array
70                (
71                )
72
73        )
74
75    [1] => Array
76        (
77            [file] => %sdebug_backtrace_limit.php
78            [line] => 3
79            [function] => b
80            [args] => Array
81                (
82                )
83
84        )
85
86    [2] => Array
87        (
88            [file] => %sdebug_backtrace_limit.php
89            [line] => 17
90            [function] => a
91            [args] => Array
92                (
93                )
94
95        )
96
97)
98Array
99(
100    [0] => Array
101        (
102            [file] => %sdebug_backtrace_limit.php
103            [line] => 7
104            [function] => c
105            [args] => Array
106                (
107                )
108
109        )
110
111    [1] => Array
112        (
113            [file] => %sdebug_backtrace_limit.php
114            [line] => 3
115            [function] => b
116            [args] => Array
117                (
118                )
119
120        )
121
122    [2] => Array
123        (
124            [file] => %sdebug_backtrace_limit.php
125            [line] => 17
126            [function] => a
127            [args] => Array
128                (
129                )
130
131        )
132
133)
134