<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.exec.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.proc-get-status.php',
    1 => 'proc_get_status',
    2 => 'proc_open で開かれたプロセスに関する情報を取得する',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => 'プログラム実行関数',
  ),
  'prev' => 
  array (
    0 => 'function.proc-close.php',
    1 => 'proc_close',
  ),
  'next' => 
  array (
    0 => 'function.proc-nice.php',
    1 => 'proc_nice',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/exec/functions/proc-get-status.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.proc-get-status" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">proc_get_status</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">proc_get_status</span> &mdash; <span class="dc-title"><span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> で開かれたプロセスに関する情報を取得する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.proc-get-status-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>proc_get_status</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$process</code></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>proc_get_status()</strong></span> は、<span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span>
   で開かれたプロセスに関する情報を取得します。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.proc-get-status-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">process</code></dt>
     <dd>
      <p class="para">
       評価される <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.proc-get-status-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   集められた情報を <span class="type"><a href="language.types.array.php" class="type array">array</a></span> として返します。
   返される配列は次のような要素を持ちます:
  </p>
  <p class="para">
  <table class="doctable informaltable">
   
    <thead>
     <tr><th>要素</th><th>型</th><th>説明</th></tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>command</td>
      <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
      <td>
       <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> に指定されたコマンド文字列。
      </td>
     </tr>

     <tr>
      <td>pid</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>プロセス ID</td>
     </tr>

     <tr>
      <td>running</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       もしプロセスがまだ動いている場合は、<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> 、すでに終了している場合は
       <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。
      </td>
     </tr>

     <tr>
      <td>signaled</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       子プロセスが、キャッチされていないシグナルにより終了した場合に
       <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> となります。Windows では常に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> にセットされます。
      </td>
     </tr>

     <tr>
      <td>stopped</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       子プロセスが、シグナルにより停止した時に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> となります。
       Windows では常に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> にセットされます。
      </td>
     </tr>

     <tr>
      <td>exitcode</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       プロセスが返した終了コード
       (<code class="literal">running</code> が <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> の時のみ意味を持ちます)。
       PHP 8.3.0 より前のバージョンでは、
       正しい値を返すのは関数を最初にコールした時のみで、次に
       コールした際には <code class="literal">-1</code> を返していました。
      </td>
     </tr>

     <tr>
      <td>cached</td>
      <td><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></td>
      <td>
       PHP 8.3.0 以降、終了コードがキャッシュされた場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を返します。
       キャッシュは、この関数を後にコールした場合でも、
       終了コードを失わないようにするために必要です。
      </td>
     </tr>

     <tr>
      <td>termsig</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       プロセスを終了させたシグナルの番号です (<code class="literal">signaled</code> が
       <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> の時のみ意味を持ちます)。
      </td>
     </tr>

     <tr>
      <td>stopsig</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       プロセスを停止させたシグナルの番号です (<code class="literal">stopped</code> が
       <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> の時のみ意味を持ちます)。
      </td>
     </tr>

    </tbody>
   
  </table>

  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.proc-get-status-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.3.0</td>
      <td>
       返される配列に <code class="literal">&quot;cached&quot;</code>
       エントリが含まれるようになりました。
       PHP 8.3.0 より前のバージョンでは、
       最初にこの関数がコールされた場合にのみ、
       正しい終了コードを返していました。
       <code class="literal">&quot;cached&quot;</code> エントリは、
       終了コードがキャッシュされていることを示します。
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.proc-get-status-seealso">
  <h3 class="title">参考</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.proc-open.php" class="function" rel="rdfs-seeAlso">proc_open()</a> - コマンドを実行し、入出力用にファイルポインタを開く</span></li>
   </ul>
  </p>
 </div>

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