<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.filesystem.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.is-executable.php',
    1 => 'is_executable',
    2 => 'Indique si le fichier est ex&eacute;cutable',
  ),
  'up' => 
  array (
    0 => 'ref.filesystem.php',
    1 => 'Fonctions sur les syst&egrave;mes de fichiers',
  ),
  'prev' => 
  array (
    0 => 'function.is-dir.php',
    1 => 'is_dir',
  ),
  'next' => 
  array (
    0 => 'function.is-file.php',
    1 => 'is_file',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/filesystem/functions/is-executable.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.is-executable" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">is_executable</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">is_executable</span> &mdash; <span class="dc-title">Indique si le fichier est exécutable</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.is-executable-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>is_executable</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Indique si le fichier est exécutable.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.is-executable-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">filename</code></dt>
     <dd>
      <p class="para">
       Chemin vers le fichier.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.is-executable-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si le fichier existe et qu&#039;il est exécutable, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> sinon.
   Sur les systèmes POSIX, un fichier est exécutable si le bit exécutable des
   permissions de fichier est défini. Sur Windows, voir la note ci-dessous.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.is-executable-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
En cas d&#039;échec, une alerte de type <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> sera émise.
</p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.is-executable-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>is_executable()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$file </span><span style="color: #007700">= </span><span style="color: #DD0000">'/home/vincent/somefile.sh'</span><span style="color: #007700">;<br /><br />if (</span><span style="color: #0000BB">is_executable</span><span style="color: #007700">(</span><span style="color: #0000BB">$file</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #0000BB">$file</span><span style="color: #007700">.</span><span style="color: #DD0000">' est exécutable'</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #0000BB">$file</span><span style="color: #007700">.</span><span style="color: #DD0000">' n\'est pas exécutable'</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.is-executable-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara">
 Les résultats de cette fonction sont mis en cache.
 Voyez la fonction <span class="function"><a href="function.clearstatcache.php" class="function">clearstatcache()</a></span> pour plus de détails.
</span></p></blockquote>
  <div class="tip"><strong class="tip">Astuce</strong><p class="simpara">
 À partir de PHP 5.0.0, cette fonction peut aussi être utilisée avec <em>quelques</em> protocoles url.
 Lisez <a href="wrappers.php" class="xref">Liste des protocoles et des gestionnaires support&eacute;s</a> pour connaître les protocoles supportant la famille de fonctionnalités de
 <span class="function"><a href="function.stat.php" class="function">stat()</a></span>.
</p></div>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    Sur Windows, un fichier est considéré exécutable, si c&#039;est un fichier
    proprement exécutable tel que rapporté par l&#039;API Win
    <code class="literal">GetBinaryType()</code>; pour des raisons de rétro-compatibilité,
    les fichiers qui ont comme extension <var class="filename">.bat</var> ou
    <var class="filename">.cmd</var> sont aussi considérés comme exécutables.
    Antérieur à PHP 7.4.0, tout fichier non vide avec une extension
    <var class="filename">.exe</var> ou <var class="filename">.com</var> était considéré
    exécutable. À noter que <var class="envar">PATHEXT</var> n&#039;est pas pertinent pour
    <span class="function"><strong>is_executable()</strong></span>.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.is-executable-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.is-file.php" class="function" rel="rdfs-seeAlso">is_file()</a> - Indique si le fichier est un v&eacute;ritable fichier</span></li>
    <li><span class="function"><a href="function.is-link.php" class="function" rel="rdfs-seeAlso">is_link()</a> - Indique si le fichier est un lien symbolique</span></li>
   </ul>
  </p>
 </div>


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