<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pcntl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.pcntl-exec.php',
    1 => 'pcntl_exec',
    2 => 'Executes specified program in current process space',
  ),
  'up' => 
  array (
    0 => 'ref.pcntl.php',
    1 => 'PCNTL Functions',
  ),
  'prev' => 
  array (
    0 => 'function.pcntl-errno.php',
    1 => 'pcntl_errno',
  ),
  'next' => 
  array (
    0 => 'function.pcntl-fork.php',
    1 => 'pcntl_fork',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pcntl/functions/pcntl-exec.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pcntl-exec" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pcntl_exec</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">pcntl_exec</span> &mdash; <span class="dc-title">Executes specified program in current process space</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.pcntl-exec-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pcntl_exec</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path</code></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$args</code><span class="initializer"> = []</span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$env_vars</code><span class="initializer"> = []</span></span>): <span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></div>

  <p class="para rdfs-comment">
   Executes the program with the given arguments.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pcntl-exec-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">path</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">path</code> must be the path to a binary executable or a
       script with a valid path pointing to an executable in the shebang (
       #!/usr/local/bin/perl for example) as the first line.  See your system&#039;s
       man execve(2) page for additional information.
      </p>
     </dd>
    
    
     <dt><code class="parameter">args</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">args</code> is an array of argument strings passed to the
       program.
      </p>
     </dd>
    
    
     <dt><code class="parameter">env_vars</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">env_vars</code> is an array of strings which are passed as
       environment to the program.  The array is in the format of name =&gt; value,
       the key being the name of the environmental variable and the value being
       the value of that variable.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pcntl-exec-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
 </div>


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