<?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 => 'ja',
  ),
  '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' => 'ja',
    '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">
   <code class="literal">opcache.restrict_api</code> を使用中で、
   かつ現在のパスがルール違反の場合、
   E_WARNING が発生します。
   ステータス情報は返されません。
  </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">opcache.revalidate_freq</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); ?>