<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectiongenerator.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'it',
  ),
  'this' => 
  array (
    0 => 'reflectiongenerator.gettrace.php',
    1 => 'ReflectionGenerator::getTrace',
    2 => 'Gets the trace of the executing generator',
  ),
  'up' => 
  array (
    0 => 'class.reflectiongenerator.php',
    1 => 'ReflectionGenerator',
  ),
  'prev' => 
  array (
    0 => 'reflectiongenerator.getthis.php',
    1 => 'ReflectionGenerator::getThis',
  ),
  'next' => 
  array (
    0 => 'reflectiongenerator.isclosed.php',
    1 => 'ReflectionGenerator::isClosed',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/reflection/reflectiongenerator/gettrace.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectiongenerator.gettrace" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionGenerator::getTrace</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ReflectionGenerator::getTrace</span> &mdash; <span class="dc-title">Gets the trace of the executing generator</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectiongenerator.gettrace-description">
  <h3 class="title">Descrizione</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionGenerator::getTrace</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="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Get the trace of the currently executing generator.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-reflectiongenerator.gettrace-parameters">
  <h3 class="title">Elenco dei parametri</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       The value of <code class="parameter">options</code> can be any of
       the following flags.
      </p>
      <p class="para">
       <table class="doctable table">
        <caption><strong>Available options</strong></caption>
        
         <thead>
          <tr>
           <th>Option</th>
           <th>Description</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>
            <strong><code><a href="reserved.constants.php#constant.debug-backtrace-provide-object">DEBUG_BACKTRACE_PROVIDE_OBJECT</a></code></strong>
           </td>
           <td>
            Default.
           </td>
          </tr>

          <tr>
           <td>
            <strong><code><a href="reserved.constants.php#constant.debug-backtrace-ignore-args">DEBUG_BACKTRACE_IGNORE_ARGS</a></code></strong>
           </td>
           <td>
            Don&#039;t include the argument information for functions in the stack
            trace.
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectiongenerator.gettrace-returnvalues">
  <h3 class="title">Valori restituiti</h3>
  <p class="para">
   Returns the trace of the currently executing generator.
  </p>
 </div>


  <div class="refsect1 examples" id="refsect1-reflectiongenerator.gettrace-examples">
  <h3 class="title">Esempi</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="methodname"><strong>ReflectionGenerator::getTrace()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">foo</span><span style="color: #007700">() {<br />    yield </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />}<br /><br />function </span><span style="color: #0000BB">bar</span><span style="color: #007700">()<br />{<br />    yield from </span><span style="color: #0000BB">foo</span><span style="color: #007700">();<br />}<br /><br />function </span><span style="color: #0000BB">baz</span><span style="color: #007700">()<br />{<br />    yield from </span><span style="color: #0000BB">bar</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #0000BB">$gen </span><span style="color: #007700">= </span><span style="color: #0000BB">baz</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$gen</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">valid</span><span style="color: #007700">(); </span><span style="color: #FF8000">// start the generator<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">((new </span><span style="color: #0000BB">ReflectionGenerator</span><span style="color: #007700">(</span><span style="color: #0000BB">$gen</span><span style="color: #007700">))-&gt;</span><span style="color: #0000BB">getTrace</span><span style="color: #007700">());</span></span></code></div>
    </div>

    <div class="example-contents"><p>Il precedente esempio visualizzerà
qualcosa simile a:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">array(2) {
  [0]=&gt;
  array(4) {
    [&quot;file&quot;]=&gt;
    string(18) &quot;example.php&quot;
    [&quot;line&quot;]=&gt;
    int(8)
    [&quot;function&quot;]=&gt;
    string(3) &quot;foo&quot;
    [&quot;args&quot;]=&gt;
    array(0) {
    }
  }
  [1]=&gt;
  array(4) {
    [&quot;file&quot;]=&gt;
    string(18) &quot;example.php&quot;
    [&quot;line&quot;]=&gt;
    int(12)
    [&quot;function&quot;]=&gt;
    string(3) &quot;bar&quot;
    [&quot;args&quot;]=&gt;
    array(0) {
    }
  }
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectiongenerator.gettrace-seealso">
  <h3 class="title">Vedere anche:</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="reflectiongenerator.getfunction.php" class="methodname" rel="rdfs-seeAlso">ReflectionGenerator::getFunction()</a> - Gets the function name of the generator</span></li>
    <li><span class="methodname"><a href="reflectiongenerator.getthis.php" class="methodname" rel="rdfs-seeAlso">ReflectionGenerator::getThis()</a> - Gets the $this value of the generator</span></li>
   </ul>
  </p>
 </div>


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