reference/errorfunc/functions/debug-backtrace.xml
e203b12d7964aa7c729e1f7c26fcbf357fc9fb63
...
...
@@ -10,7 +10,8 @@
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
12
<type>array</type><methodname>debug_backtrace</methodname>
13
-
<methodparam choice="opt"><type>bool</type><parameter>provide_object</parameter><initializer>true</initializer></methodparam>
13
+
<methodparam choice="opt"><type>int</type><parameter>options</parameter><initializer><constant>DEBUG_BACKTRACE_PROVIDE_OBJECT</constant></initializer></methodparam>
14
+
<methodparam choice="opt"><type>int</type><parameter>limit</parameter><initializer>0</initializer></methodparam>
14
15
</methodsynopsis>
15
16
<para>
16
17
<function>debug_backtrace</function> generates a PHP backtrace.
...
...
@@ -22,10 +23,87 @@
22
23
<para>
23
24
<variablelist>
24
25
<varlistentry>
25
-
<term><parameter>provide_object</parameter></term>
26
+
<term><parameter>options</parameter></term>
26
27
<listitem>
27
28
<para>
28
-
Whether or not to populate the "object" index.
29
+
This parameter is a bitmask for the following options:
30
+
<table>
31
+
<title><function>debug_backtrace</function> options</title>
32
+
<tgroup cols="2">
33
+
<tbody>
34
+
<row>
35
+
<entry>DEBUG_BACKTRACE_PROVIDE_OBJECT</entry>
36
+
<entry>
37
+
Whether or not to populate the "object" index.
38
+
</entry>
39
+
</row>
40
+
<row>
41
+
<entry>DEBUG_BACKTRACE_IGNORE_ARGS</entry>
42
+
<entry>
43
+
Whether or not to omit the "args" index, and thus all the function/method arguments,
44
+
to save memory.
45
+
</entry>
46
+
</row>
47
+
</tbody>
48
+
</tgroup>
49
+
</table>
50
+
<note>
51
+
<para>
52
+
There are four possible combinations:
53
+
<table>
54
+
<title><function>debug_backtrace</function> options</title>
55
+
<tgroup cols="2">
56
+
<tbody>
57
+
<row>
58
+
<entry><code>debug_backtrace()</code></entry>
59
+
<entry morerows="2" valign="middle">
60
+
Populates both indexes
61
+
</entry>
62
+
</row>
63
+
<row>
64
+
<entry><code>debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT)</code></entry>
65
+
</row>
66
+
<row>
67
+
<entry><code>debug_backtrace(1)</code></entry>
68
+
</row>
69
+
<row>
70
+
<entry><code>debug_backtrace(0)</code></entry>
71
+
<entry valign="middle">
72
+
Omits index <literal>"object"</literal> and populates index <literal>"args"</literal>.
73
+
</entry>
74
+
</row>
75
+
<row>
76
+
<entry><code>debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)</code></entry>
77
+
<entry morerows="1" valign="middle">
78
+
Omits index <literal>"object"</literal> <emphasis>and</emphasis> index <literal>"args"</literal>.
79
+
</entry>
80
+
</row>
81
+
<row>
82
+
<entry><code>debug_backtrace(2)</code></entry>
83
+
</row>
84
+
<row>
85
+
<entry><code>debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT|DEBUG_BACKTRACE_IGNORE_ARGS)</code></entry>
86
+
<entry morerows="1" valign="middle">
87
+
Populate index <literal>"object"</literal> <emphasis>and</emphasis> omit index <literal>"args"</literal>.
88
+
</entry>
89
+
</row>
90
+
<row>
91
+
<entry><code>debug_backtrace(3)</code></entry>
92
+
</row>
93
+
</tbody>
94
+
</tgroup>
95
+
</table>
96
+
</para>
97
+
</note>
98
+
</para>
99
+
</listitem>
100
+
</varlistentry>
101
+
<varlistentry>
102
+
<term><parameter>limit</parameter></term>
103
+
<listitem>
104
+
<para>
105
+
This parameter can be used to limit the number of stack frames returned.
106
+
By default (<parameter>limit</parameter>=<literal>0</literal>) it returns all stack frames.
29
107
</para>
30
108
</listitem>
31
109
</varlistentry>
...
...
@@ -36,7 +114,7 @@
36
114
<refsect1 role="returnvalues">
37
115
&reftitle.returnvalues;
38
116
<para>
39
-
Returns an associative <type>array</type>. The possible returned elements
117
+
Returns an array of associative <type>array</type>s. The possible returned elements
40
118
are as follows:
41
119
</para>
42
120
<para>
...
...
@@ -61,7 +139,7 @@
61
139
</row>
62
140
<row>
63
141
<entry>line</entry>
64
-
<entry><type>integer</type></entry>
142
+
<entry><type>int</type></entry>
65
143
<entry>
66
144
The current line number. See also
67
145
<link linkend="language.constants.predefined">__LINE__</link>.
...
...
@@ -94,7 +172,7 @@
94
172
<entry>type</entry>
95
173
<entry><type>string</type></entry>
96
174
<entry>
97
-
The current call type. If a method call, "->" is returned. If a static
175
+
The current call type. If a method call, "-&gt;" is returned. If a static
98
176
method call, "::" is returned. If a function call, nothing is returned.
99
177
</entry>
100
178
</row>
...
...
@@ -112,36 +190,6 @@
112
190
</para>
113
191
</refsect1>
114
192

115
-
<refsect1 role="changelog">
116
-
&reftitle.changelog;
117
-
<para>
118
-
<informaltable>
119
-
<tgroup cols="2">
120
-
<thead>
121
-
<row>
122
-
<entry>&Version;</entry>
123
-
<entry>&Description;</entry>
124
-
</row>
125
-
</thead>
126
-
<tbody>
127
-
<row>
128
-
<entry>5.2.5</entry>
129
-
<entry>
130
-
Added the optional parameter <parameter>provide_object</parameter>.
131
-
</entry>
132
-
</row>
133
-
<row>
134
-
<entry>5.1.1</entry>
135
-
<entry>
136
-
Added the current <type>object</type> as a possible return element.
137
-
</entry>
138
-
</row>
139
-
</tbody>
140
-
</tgroup>
141
-
</informaltable>
142
-
</para>
143
-
</refsect1>
144
-

145
193
<refsect1 role="examples">
146
194
&reftitle.examples;
147
195
<para>
...
...
@@ -169,7 +217,7 @@ include_once '/tmp/a.php';
169
217
</programlisting>
170
218
<para>
171
219
Results similar to the following when executing
172
-
<filename>/tmp/b.php</filename>:
220
+
<filename>/tmp/b.php</filename>:
173
221
</para>
174
222
<screen>
175
223
<![CDATA[
...
...
@@ -212,7 +260,6 @@ array(4) {
212
260
</para>
213
261
</refsect1>
214
262
</refentry>
215
-

216
263
<!-- Keep this comment at the end of the file
217
264
Local variables:
218
265
mode: sgml
219
266