<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.errorfunc.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.debug-backtrace.php',
    1 => 'debug_backtrace',
    2 => 'Generates a backtrace',
  ),
  'up' => 
  array (
    0 => 'ref.errorfunc.php',
    1 => 'Функції Обробки Помилок',
  ),
  'prev' => 
  array (
    0 => 'ref.errorfunc.php',
    1 => 'Функції Обробки Помилок',
  ),
  'next' => 
  array (
    0 => 'function.debug-print-backtrace.php',
    1 => 'debug_print_backtrace',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/errorfunc/functions/debug-backtrace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.debug-backtrace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">debug_backtrace</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">debug_backtrace</span> &mdash; <span class="dc-title">Generates a backtrace</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.debug-backtrace-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>debug_backtrace</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$options</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.debug-backtrace-provide-object">DEBUG_BACKTRACE_PROVIDE_OBJECT</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$limit</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>debug_backtrace()</strong></span> generates a PHP backtrace.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.debug-backtrace-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       This parameter is a bitmask for the following options:
       <table class="doctable table">
        <caption><strong><span class="function"><strong>debug_backtrace()</strong></span> options</strong></caption>
        
         <tbody class="tbody">
          <tr>
           <td>DEBUG_BACKTRACE_PROVIDE_OBJECT</td>
           <td>
            Whether or not to populate the &quot;object&quot; index.
           </td>
          </tr>

          <tr>
           <td>DEBUG_BACKTRACE_IGNORE_ARGS</td>
           <td>
            Whether or not to omit the &quot;args&quot; index, and thus all the function/method arguments,
            to save memory.
           </td>
          </tr>

         </tbody>
        
       </table>

       <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
        <p class="para">
         There are four possible combinations:
         <table class="doctable table">
          <caption><strong><span class="function"><strong>debug_backtrace()</strong></span> options</strong></caption>
          
           <tbody class="tbody">
            <tr>
             <td><code class="code">debug_backtrace()</code></td>
             <td rowspan="3" style="vertical-align: middle;">
              Populates both indexes
             </td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT)</code></td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(1)</code></td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(0)</code></td>
             <td style="vertical-align: middle;">
              Omits index <code class="literal">&quot;object&quot;</code> and populates index <code class="literal">&quot;args&quot;</code>.
             </td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS)</code></td>
             <td rowspan="2" style="vertical-align: middle;">
              Omits index <code class="literal">&quot;object&quot;</code> <em>and</em> index <code class="literal">&quot;args&quot;</code>.
             </td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(2)</code></td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT|DEBUG_BACKTRACE_IGNORE_ARGS)</code></td>
             <td rowspan="2" style="vertical-align: middle;">
              Populate index <code class="literal">&quot;object&quot;</code> <em>and</em> omit index <code class="literal">&quot;args&quot;</code>.
             </td>
            </tr>

            <tr>
             <td><code class="code">debug_backtrace(3)</code></td>
            </tr>

           </tbody>
          
         </table>

        </p>
       </p></blockquote>
      </p>
     </dd>
    
    
     <dt><code class="parameter">limit</code></dt>
     <dd>
      <p class="para">
       This parameter can be used to limit the number of stack frames returned.
       By default (<code class="parameter">limit</code>=<code class="literal">0</code>) it returns all stack frames.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.debug-backtrace-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an array of associative <span class="type"><a href="language.types.array.php" class="type array">array</a></span>s. The possible returned elements
   are as follows:
  </p>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Possible returned elements from <span class="function"><strong>debug_backtrace()</strong></span></strong></caption>
    
     <thead>
      <tr>
       <th>Назва</th>
       <th>Тип</th>
       <th>Опис</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>function</td>
       <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
       <td>
        The current function name.  See also
        <a href="language.constants.magic.php" class="link">__FUNCTION__</a>.
       </td>
      </tr>

      <tr>
       <td>line</td>
       <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
       <td>
        The current line number.  See also
        <a href="language.constants.magic.php" class="link">__LINE__</a>.
       </td>
      </tr>

      <tr>
       <td>file</td>
       <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
       <td>
        The current file name.  See also
        <a href="language.constants.magic.php" class="link">__FILE__</a>.
       </td>
      </tr>

      <tr>
       <td>class</td>
       <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
       <td>
        The current <a href="language.oop5.php" class="link">class</a> name.  See also
        <a href="language.constants.magic.php" class="link">__CLASS__</a>
       </td>
      </tr>

      <tr>
       <td>object</td>
       <td><span class="type"><a href="language.types.object.php" class="type object">object</a></span></td>
       <td>
        The current <a href="language.oop5.php" class="link">object</a>.
       </td>
      </tr>

      <tr>
       <td>type</td>
       <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
       <td>
        The current call type. If a method call, &quot;-&gt;&quot; is returned. If a static
        method call, &quot;::&quot; is returned. If a function call, nothing is returned.
       </td>
      </tr>

      <tr>
       <td>args</td>
       <td><span class="type"><a href="language.types.array.php" class="type array">array</a></span></td>
       <td>
        If inside a function, this lists the functions arguments.  If
        inside an included file, this lists the included file name(s).
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.debug-backtrace-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>debug_backtrace()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// filename: /tmp/a.php<br /><br /></span><span style="color: #007700">function </span><span style="color: #0000BB">a_test</span><span style="color: #007700">(</span><span style="color: #0000BB">$str</span><span style="color: #007700">)<br />{<br />    echo </span><span style="color: #DD0000">"\nHi: </span><span style="color: #0000BB">$str</span><span style="color: #DD0000">"</span><span style="color: #007700">;<br />    </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">debug_backtrace</span><span style="color: #007700">());<br />}<br /><br /></span><span style="color: #0000BB">a_test</span><span style="color: #007700">(</span><span style="color: #DD0000">'friend'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;<br /></span><br /><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// filename: /tmp/b.php<br /></span><span style="color: #007700">include_once </span><span style="color: #DD0000">'/tmp/a.php'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
     Results similar to the following when executing
     <var class="filename">/tmp/b.php</var>:
    </p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Hi: friend
array(2) {
[0]=&gt;
array(4) {
    [&quot;file&quot;] =&gt; string(10) &quot;/tmp/a.php&quot;
    [&quot;line&quot;] =&gt; int(10)
    [&quot;function&quot;] =&gt; string(6) &quot;a_test&quot;
    [&quot;args&quot;]=&gt;
    array(1) {
      [0] =&gt; &amp;string(6) &quot;friend&quot;
    }
}
[1]=&gt;
array(4) {
    [&quot;file&quot;] =&gt; string(10) &quot;/tmp/b.php&quot;
    [&quot;line&quot;] =&gt; int(2)
    [&quot;args&quot;] =&gt;
    array(1) {
      [0] =&gt; string(10) &quot;/tmp/a.php&quot;
    }
    [&quot;function&quot;] =&gt; string(12) &quot;include_once&quot;
  }
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.debug-backtrace-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.trigger-error.php" class="function" rel="rdfs-seeAlso">trigger_error()</a> - Generates a user-level error/warning/notice message</span></li>
    <li><span class="function"><a href="function.debug-print-backtrace.php" class="function" rel="rdfs-seeAlso">debug_print_backtrace()</a> - Prints a backtrace</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>