<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.curl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.curl-version.php',
    1 => 'curl_version',
    2 => 'Retourne la version courante de cURL',
  ),
  'up' => 
  array (
    0 => 'ref.curl.php',
    1 => 'Fonctions cURL',
  ),
  'prev' => 
  array (
    0 => 'function.curl_upkeep.php',
    1 => 'curl_upkeep',
  ),
  'next' => 
  array (
    0 => 'class.curlhandle.php',
    1 => 'CurlHandle',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/curl/functions/curl-version.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.curl-version" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">curl_version</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.2, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">curl_version</span> &mdash; <span class="dc-title">Retourne la version courante de cURL</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.curl-version-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>curl_version</strong></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="para rdfs-comment">
   Retourne des informations sur la version cURL.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.curl-version-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">Cette fonction ne contient aucun paramètre.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.curl-version-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne un tableau associatif contenant les éléments suivants :
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Clé</th>
       <th>Description de la valeur</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>version_number</td>
       <td>numéro de version cURL 24 bit</td>
      </tr>

      <tr>
       <td>version</td>
       <td>numéro de version cURL, sous la forme d&#039;une chaîne de caractères</td>
      </tr>

      <tr>
       <td>ssl_version_number</td>
       <td>numéro de version OpenSSL 24 bit</td>
      </tr>

      <tr>
       <td>ssl_version</td>
       <td>numéro de version OpenSSL, sous la forme d&#039;une chaîne de caractères</td>
      </tr>

      <tr>
       <td>libz_version</td>
       <td>numéro de version zlib, sous la forme d&#039;une chaîne de caractères</td>
      </tr>

      <tr>
       <td>host</td>
       <td>Informations sur l&#039;hôte sur lequel cURL a été construit</td>
      </tr>

      <tr>
       <td>age</td>
       <td class="empty">&nbsp;</td>
      </tr>

      <tr>
       <td>features</td>
       <td>Un masque de constantes <strong><code><a href="curl.constants.php#constant.curl-version-altsvc">CURL_VERSION_<span class="replaceable">*</span></a></code></strong></td>
      </tr>

      <tr>
       <td>protocols</td>
       <td>Un tableau de noms de protocoles supportés par cURL</td>
      </tr>

      <tr>
       <td>feature_list</td>
       <td>
        Un tableau associatif de toutes les fonctionnalités cURL connues, et si elles
        sont supportées (<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>) ou non (<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>).
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.curl-version-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       <code class="literal">features_list</code> ajouté.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       Le paramètre optionnel <code class="parameter">age</code> a été supprimé.
      </td>
     </tr>

     <tr>
      <td>7.4.0</td>
      <td>
       Le paramètre optionnel <code class="parameter">age</code> est obsolète ;
       si une valeur est fournie, elle est ignorée.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.curl-version-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>curl_version()</strong></span></strong></p>
    <div class="example-contents"><p>
     Cet exemple analyse les fonctionnalités disponibles dans la version
     courante de cURL en utilisant le masque <code class="literal">&#039;features&#039;</code>
     retourné par la fonction <span class="function"><strong>curl_version()</strong></span>.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Récupère la version de cURL, sous la forme d'un tableau<br /></span><span style="color: #0000BB">$version </span><span style="color: #007700">= </span><span style="color: #0000BB">curl_version</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// Voici les champs qui peuvent être utilisés<br />// afin de vérifier les fonctionnalités présentes dans cURL<br /></span><span style="color: #0000BB">$bitfields </span><span style="color: #007700">= Array(<br />             </span><span style="color: #DD0000">'CURL_VERSION_IPV6'</span><span style="color: #007700">, <br />             </span><span style="color: #DD0000">'CURL_VERSION_KERBEROS4'</span><span style="color: #007700">, <br />             </span><span style="color: #DD0000">'CURL_VERSION_SSL'</span><span style="color: #007700">, <br />             </span><span style="color: #DD0000">'CURL_VERSION_LIBZ'<br />             </span><span style="color: #007700">);<br /><br /><br />foreach(</span><span style="color: #0000BB">$bitfields </span><span style="color: #007700">as </span><span style="color: #0000BB">$feature</span><span style="color: #007700">)<br />{<br />    echo </span><span style="color: #0000BB">$feature </span><span style="color: #007700">. (</span><span style="color: #0000BB">$version</span><span style="color: #007700">[</span><span style="color: #DD0000">'features'</span><span style="color: #007700">] &amp; </span><span style="color: #0000BB">constant</span><span style="color: #007700">(</span><span style="color: #0000BB">$feature</span><span style="color: #007700">) ? </span><span style="color: #DD0000">' présente' </span><span style="color: #007700">: </span><span style="color: #DD0000">' absente'</span><span style="color: #007700">);<br />    echo </span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


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