<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.xhprof.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.xhprof-enable.php',
    1 => 'xhprof_enable',
    2 => 'Start xhprof profiler',
  ),
  'up' => 
  array (
    0 => 'ref.xhprof.php',
    1 => 'Xhprof Функції',
  ),
  'prev' => 
  array (
    0 => 'function.xhprof-disable.php',
    1 => 'xhprof_disable',
  ),
  'next' => 
  array (
    0 => 'function.xhprof-sample-disable.php',
    1 => 'xhprof_sample_disable',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/xhprof/functions/xhprof-enable.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.xhprof-enable" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">xhprof_enable</h1>
  <p class="verinfo">(PECL xhprof &gt;= 0.9.0)</p><p class="refpurpose"><span class="refname">xhprof_enable</span> &mdash; <span class="dc-title">Start xhprof profiler</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.xhprof-enable-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>xhprof_enable</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   Start xhprof profiling.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.xhprof-enable-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       Optional flags to add additional information to the profiling. See the
       <a href="xhprof.constants.php" class="link">XHprof constants</a> for further
       information about these flags, e.g., <strong><code><a href="xhprof.constants.php#constant.xhprof-flags-memory">XHPROF_FLAGS_MEMORY</a></code></strong>
       to enable memory profiling.
      </p>
     </dd>
    
    
     <dt><code class="parameter">options</code></dt>
     <dd>
      <p class="para">
       An <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of optional options, namely, the
       &#039;ignored_functions&#039; option to pass in functions to be ignored
       during profiling.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.xhprof-enable-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.xhprof-enable-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PECL xhprof 0.9.2</td>
      <td>
       The optional <code class="parameter">options</code> parameter was added.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>



 <div class="refsect1 examples" id="refsect1-function.xhprof-enable-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="function"><strong>xhprof_enable()</strong></span> examples</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">// 1. elapsed time + memory + CPU profiling; and ignore built-in (internal) functions<br /></span><span style="color: #0000BB">xhprof_enable</span><span style="color: #007700">(</span><span style="color: #0000BB">XHPROF_FLAGS_NO_BUILTINS </span><span style="color: #007700">| </span><span style="color: #0000BB">XHPROF_FLAGS_CPU </span><span style="color: #007700">| </span><span style="color: #0000BB">XHPROF_FLAGS_MEMORY</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// 2. elapsed time profiling; ignore call_user_func* during profiling<br /></span><span style="color: #0000BB">xhprof_enable</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">0</span><span style="color: #007700">,<br />    array(</span><span style="color: #DD0000">'ignored_functions' </span><span style="color: #007700">=&gt;  array(</span><span style="color: #DD0000">'call_user_func'</span><span style="color: #007700">,<br />                                        </span><span style="color: #DD0000">'call_user_func_array'</span><span style="color: #007700">)));<br />                                       <br /></span><span style="color: #FF8000">// 3. elapsed time + memory profiling; ignore call_user_func* during profiling<br /></span><span style="color: #0000BB">xhprof_enable</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">XHPROF_FLAGS_MEMORY</span><span style="color: #007700">,<br />    array(</span><span style="color: #DD0000">'ignored_functions' </span><span style="color: #007700">=&gt;  array(</span><span style="color: #DD0000">'call_user_func'</span><span style="color: #007700">,<br />                                        </span><span style="color: #DD0000">'call_user_func_array'</span><span style="color: #007700">)));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.xhprof-enable-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.xhprof-disable.php" class="function" rel="rdfs-seeAlso">xhprof_disable()</a> - Stops xhprof profiler</span></li>
   <li><span class="function"><a href="function.xhprof-sample-enable.php" class="function" rel="rdfs-seeAlso">xhprof_sample_enable()</a> - Start XHProf profiling in sampling mode</span></li>
   <li><span class="function"><a href="function.memory-get-usage.php" class="function" rel="rdfs-seeAlso">memory_get_usage()</a> - Returns the amount of memory allocated to PHP</span></li>
   <li><span class="function"><a href="function.getrusage.php" class="function" rel="rdfs-seeAlso">getrusage()</a> - Gets the current resource usages</span></li>
  </ul>
 </div>

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