mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-06-17 21:16:57 +08:00
169 lines
6.1 KiB
HTML
169 lines
6.1 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>打印一条回溯。</title>
|
|
</head>
|
|
<body class="docs"><div id="layout">
|
|
<div id="layout-content"><div id="function.debug-print-backtrace" class="refentry">
|
|
<div class="refnamediv">
|
|
<h1 class="refname">debug_print_backtrace</h1>
|
|
<p class="verinfo">(PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">debug_print_backtrace</span> — <span class="dc-title">
|
|
打印一条回溯。
|
|
</span></p>
|
|
|
|
</div>
|
|
|
|
<div class="refsect1 description" id="refsect1-function.debug-print-backtrace-description">
|
|
<h3 class="title">说明</h3>
|
|
<div class="methodsynopsis dc-description">
|
|
<span class="methodname"><strong>debug_print_backtrace</strong></span>
|
|
([ <span class="methodparam"><span class="type">int</span> <code class="parameter">$options</code><span class="initializer"> = 0</span></span>
|
|
[, <span class="methodparam"><span class="type">int</span> <code class="parameter">$limit</code><span class="initializer"> = 0</span></span>
|
|
]] ) : <span class="type"><span class="type void">void</span></span></div>
|
|
|
|
<p class="para rdfs-comment">
|
|
<span class="function"><strong>debug_print_backtrace()</strong></span> 打印了一条 PHP 回溯。它打印了函数调用、被 included/required 的文件和
|
|
<span class="function"><a href="eval.html" class="function">eval()</a></span> 的代码。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 parameters" id="refsect1-function.debug-print-backtrace-parameters">
|
|
<h3 class="title">参数</h3>
|
|
<p class="para">
|
|
<dl>
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">options</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
从 5.3.6 开始,这个参数是以下选项的位掩码:
|
|
<table class="doctable table">
|
|
<caption><strong><span class="function"><strong>debug_print_backtrace()</strong></span> 选项</strong></caption>
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td>DEBUG_BACKTRACE_IGNORE_ARGS</td>
|
|
<td>
|
|
是否忽略 "args" 的索引,包括所有的 function/method 的参数,能够节省内存开销。
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>
|
|
<code class="parameter">limit</code></dt>
|
|
|
|
<dd>
|
|
|
|
<p class="para">
|
|
从 5.4.0 开始,这个参数能够用于限制返回堆栈帧的数量。
|
|
默认为 (<code class="parameter">limit</code>=<em>0</em>) ,返回所有的堆栈帧。
|
|
</p>
|
|
</dd>
|
|
|
|
|
|
</dl>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 returnvalues" id="refsect1-function.debug-print-backtrace-returnvalues">
|
|
<h3 class="title">返回值</h3>
|
|
<p class="para">
|
|
没有返回值。
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 changelog" id="refsect1-function.debug-print-backtrace-changelog">
|
|
<h3 class="title">更新日志</h3>
|
|
<p class="para">
|
|
<table class="doctable informaltable">
|
|
|
|
<thead>
|
|
<tr>
|
|
<th>版本</th>
|
|
<th>说明</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody class="tbody">
|
|
<tr>
|
|
<td>5.4.0</td>
|
|
<td>
|
|
添加了可选的参数 <code class="parameter">limit</code>。
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td>5.3.6</td>
|
|
<td>
|
|
添加了可选的参数 <code class="parameter">options</code>。
|
|
</td>
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 examples" id="refsect1-function.debug-print-backtrace-examples">
|
|
<h3 class="title">范例</h3>
|
|
<p class="para">
|
|
<div class="example" id="example-457">
|
|
<p><strong>Example #1 <span class="function"><strong>debug_print_backtrace()</strong></span> 范例</strong></p>
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// include.php file<br /><br /></span><span style="color: #007700">function </span><span style="color: #0000BB">a</span><span style="color: #007700">() {<br /> </span><span style="color: #0000BB">b</span><span style="color: #007700">();<br />}<br /><br />function </span><span style="color: #0000BB">b</span><span style="color: #007700">() {<br /> </span><span style="color: #0000BB">c</span><span style="color: #007700">();<br />}<br /><br />function </span><span style="color: #0000BB">c</span><span style="color: #007700">(){<br /> </span><span style="color: #0000BB">debug_print_backtrace</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">a</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents">
|
|
<div class="phpcode"><pre><span style="color: #000000">
|
|
<span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// 文件 test.php<br />// 这是你应该运行的文件<br /><br /></span><span style="color: #007700">include </span><span style="color: #DD0000">'include.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?></span>
|
|
</span>
|
|
</pre></div>
|
|
</div>
|
|
|
|
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
|
|
<div class="example-contents screen">
|
|
<div class="cdata"><pre>
|
|
#0 c() called at [/tmp/include.php:10]
|
|
#1 b() called at [/tmp/include.php:6]
|
|
#2 a() called at [/tmp/include.php:17]
|
|
#3 include(/tmp/include.php) called at [/tmp/test.php:3]
|
|
</pre></div>
|
|
</div>
|
|
</div>
|
|
</p>
|
|
</div>
|
|
|
|
|
|
<div class="refsect1 seealso" id="refsect1-function.debug-print-backtrace-seealso">
|
|
<h3 class="title">参见</h3>
|
|
<p class="para">
|
|
<ul class="simplelist">
|
|
<li class="member"><span class="function"><a href="debug_backtrace.html" class="function" rel="rdfs-seeAlso">debug_backtrace()</a> - 产生一条回溯跟踪(backtrace)</span></li>
|
|
</ul>
|
|
</p>
|
|
</div>
|
|
|
|
</div></div></div></body></html> |