<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.exception.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'exception.gettrace.php',
    1 => 'Exception::getTrace',
    2 => 'Получает трассировку стека',
  ),
  'up' => 
  array (
    0 => 'class.exception.php',
    1 => 'Exception',
  ),
  'prev' => 
  array (
    0 => 'exception.getline.php',
    1 => 'Exception::getLine',
  ),
  'next' => 
  array (
    0 => 'exception.gettraceasstring.php',
    1 => 'Exception::getTraceAsString',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'language/predefined/exception/gettrace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="exception.gettrace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Exception::getTrace</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">Exception::getTrace</span> &mdash; <span class="dc-title">Получает трассировку стека</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-exception.gettrace-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>Exception::getTrace</strong></span>(): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Возвращает трассировку стека исключения.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-exception.gettrace-parameters">
  <h3 class="title">Список параметров</h3>
  
<p class="para">
 Сигнатура функции не содержит параметров.
</p>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-exception.gettrace-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Метод возвращает трассировку стека исключения в виде массива (<span class="type"><a href="language.types.array.php" class="type array">array</a></span>).
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-exception.gettrace-examples">
  <h3 class="title">Примеры</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Пример #1 Пример использования метода <span class="function"><strong>Exception::getTrace()</strong></span></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: #007700">function </span><span style="color: #0000BB">test</span><span style="color: #007700">() {<br /> throw new </span><span style="color: #0000BB">Exception</span><span style="color: #007700">;<br />}<br /><br />try {<br /> </span><span style="color: #0000BB">test</span><span style="color: #007700">();<br />} catch(</span><span style="color: #0000BB">Exception $e</span><span style="color: #007700">) {<br /> </span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$e</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTrace</span><span style="color: #007700">());<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    
<div class="example-contents"><p>
 Вывод приведённого примера будет похож на:
</p></div>

    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">array(1) {
  [0]=&gt;
  array(4) {
    [&quot;file&quot;]=&gt;
    string(22) &quot;/home/bjori/tmp/ex.php&quot;
    [&quot;line&quot;]=&gt;
    int(7)
    [&quot;function&quot;]=&gt;
    string(4) &quot;test&quot;
    [&quot;args&quot;]=&gt;
    array(0) {
    }
  }
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>

  <div class="refsect1 seealso" id="refsect1-exception.gettrace-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="throwable.gettrace.php" class="methodname" rel="rdfs-seeAlso">Throwable::getTrace()</a> - Возвращает трассировку стека</span></li>
   </ul>
  </p>
 </div>

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