<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.proc-get-status.php',
    1 => 'proc_get_status',
    2 => 'Get information about a process opened by proc_open',
  ),
  'up' => 
  array (
    0 => 'ref.exec.php',
    1 => 'Program execution Функції',
  ),
  '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' => 'en',
    '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">Get information about a process opened by <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> fetches data about a
   process opened using <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">
       The <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> that will
       be evaluated.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.proc-get-status-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   An <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of collected information.
   The returned array contains the following elements:
  </p>
  <p class="para">
  <table class="doctable informaltable">
   
    <thead>
     <tr><th>element</th><th>type</th><th>description</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>
       The command string that was passed to <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>process 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> if the process is still running, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if it has
       terminated.
      </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> if the child process has been terminated by
       an uncaught signal. Always set to <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on Windows.
      </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> if the child process has been stopped by a
       signal. Always set to <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on Windows.
      </td>
     </tr>

     <tr>
      <td>exitcode</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       The exit code returned by the process (which is only
       meaningful if <code class="literal">running</code> is <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>).
       Prior to PHP 8.3.0, only the first call of this function returned the real
       value, the following calls returned <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>
       As of PHP 8.3.0, this is <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> when the exit code is cached.
       Caching is necessary to make sure the exit code is not lost by
       subsequent calls to process APIs.
      </td>
     </tr>

     <tr>
      <td>termsig</td>
      <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
      <td>
       The number of the signal that caused the child process to terminate
       its execution (only meaningful if <code class="literal">signaled</code> is <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>
       The number of the signal that caused the child process to stop its
       execution (only meaningful if <code class="literal">stopped</code> is <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>
       The <code class="literal">&quot;cached&quot;</code> entry has been added to the returned
       array. Prior to PHP 8.3.0, only the first call returned the real exit
       code. The <code class="literal">&quot;cached&quot;</code> entry indicates that the exit code
       was cached.
      </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> - Execute a command and open file pointers for input/output</span></li>
   </ul>
  </p>
 </div>

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