<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.opcache.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.opcache-get-status.php',
    1 => 'opcache_get_status',
    2 => 'Получает информацию о состоянии кеша',
  ),
  'up' => 
  array (
    0 => 'ref.opcache.php',
    1 => 'Функции OPcache',
  ),
  'prev' => 
  array (
    0 => 'function.opcache-get-configuration.php',
    1 => 'opcache_get_configuration',
  ),
  'next' => 
  array (
    0 => 'function.opcache-invalidate.php',
    1 => 'opcache_invalidate',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/opcache/functions/opcache-get-status.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.opcache-get-status" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">opcache_get_status</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PHP 7, PHP 8, PECL ZendOpcache &gt; 7.0.2)</p><p class="refpurpose"><span class="refname">opcache_get_status</span> &mdash; <span class="dc-title">Получает информацию о состоянии кеша</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.opcache-get-status-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>opcache_get_status</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$include_scripts</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Функция возвращает информацию о состоянии экземпляра кеша в памяти.
   Она не возвращает никакой информации о файловом кеше.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.opcache-get-status-parameters">
  <h3 class="title">Список параметров</h3>
  <dl>
   
    <dt><code class="parameter">include_scripts</code></dt>
    <dd>
     <span class="simpara">
      Включить информацию о состоянии конкретного скрипта.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.opcache-get-status-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="simpara">
   Возвращает массив, опционально содержащий информацию
   о состоянии конкретного скрипта или <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, если возникла ошибка.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.opcache-get-status-errors">
  <h3 class="title">Ошибки</h3>
  <p class="simpara">
   Функция выдаст ошибку уровня E_WARNING, если настроили директиву
   <code class="literal">opcache.restrict_api</code> и текущий путь подпадает под
   запрет; информацию о состоянии функция не вернёт.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.opcache-get-status-changelog">
  <h3 class="title">Список изменений</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версия</th>
      <th>Описание</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>PHP 8.3.0</td>
      <td>
       <code class="code">opcache_get_status()[&#039;scripts&#039;][n][&#039;revalidate&#039;]</code> теперь содержит метку времени Unix о том,
       когда должна быть произведена следующая ревалидация метки времени скриптов,
       как указано в INI-директиве <a href="opcache.configuration.php#ini.opcache.revalidate-freq" class="link"><code class="literal">opcache.revalidate_freq</code></a>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.opcache-get-status-examples">
  <h3 class="title">Примеры</h3>
  <div class="example" id="example-1">
   <p><strong>Пример #1 Пример использования функции <span class="function"><strong>opcache_get_status()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">opcache_get_status</span><span style="color: #007700">());<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(9) {
  &#039;opcache_enabled&#039; =&gt;
  bool(true)
  &#039;cache_full&#039; =&gt;
  bool(false)
  &#039;restart_pending&#039; =&gt;
  bool(false)
  &#039;restart_in_progress&#039; =&gt;
  bool(false)
  &#039;memory_usage&#039; =&gt;
  array(4) {
    &#039;used_memory&#039; =&gt;
    int(9167936)
    &#039;free_memory&#039; =&gt;
    int(125049792)
    &#039;wasted_memory&#039; =&gt;
    int(0)
    &#039;current_wasted_percentage&#039; =&gt;
    double(0)
  }
  &#039;interned_strings_usage&#039; =&gt;
  array(4) {
    &#039;buffer_size&#039; =&gt;
    int(8388608)
    &#039;used_memory&#039; =&gt;
    int(2593616)
    &#039;free_memory&#039; =&gt;
    int(5794992)
    &#039;number_of_strings&#039; =&gt;
    int(10358)
  }
  &#039;opcache_statistics&#039; =&gt;
  array(13) {
    &#039;num_cached_scripts&#039; =&gt;
    int(0)
    &#039;num_cached_keys&#039; =&gt;
    int(0)
    &#039;max_cached_keys&#039; =&gt;
    int(16229)
    &#039;hits&#039; =&gt;
    int(0)
    &#039;start_time&#039; =&gt;
    int(1733310010)
    &#039;last_restart_time&#039; =&gt;
    int(0)
    &#039;oom_restarts&#039; =&gt;
    int(0)
    &#039;hash_restarts&#039; =&gt;
    int(0)
    &#039;manual_restarts&#039; =&gt;
    int(0)
    &#039;misses&#039; =&gt;
    int(0)
    &#039;blacklist_misses&#039; =&gt;
    int(0)
    &#039;blacklist_miss_ratio&#039; =&gt;
    double(0)
    &#039;opcache_hit_rate&#039; =&gt;
    double(0)
  }
  &#039;scripts&#039; =&gt;
  array(0) {
  }
  &#039;jit&#039; =&gt;
  array(7) {
    &#039;enabled&#039; =&gt;
    bool(false)
    &#039;on&#039; =&gt;
    bool(false)
    &#039;kind&#039; =&gt;
    int(5)
    &#039;opt_level&#039; =&gt;
    int(4)
    &#039;opt_flags&#039; =&gt;
    int(6)
    &#039;buffer_size&#039; =&gt;
    int(0)
    &#039;buffer_free&#039; =&gt;
    int(0)
  }
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.opcache-get-status-seealso">
  <h3 class="title">Смотрите также</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.opcache-get-configuration.php" class="function" rel="rdfs-seeAlso">opcache_get_configuration()</a> - Получает информацию о конфигурации кеша</span></li>
  </ul>
 </div>


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