<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration81.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'migration81.deprecated.php',
    1 => 'Fonctionnalit&eacute;s d&eacute;pr&eacute;ci&eacute;es',
    2 => 'Fonctionnalit&eacute;s d&eacute;pr&eacute;ci&eacute;es',
  ),
  'up' => 
  array (
    0 => 'migration81.php',
    1 => 'Migration de PHP 8.0.x vers PHP 8.1.x',
  ),
  'prev' => 
  array (
    0 => 'migration81.incompatible.php',
    1 => 'Les changements de r&eacute;trocompatibilit&eacute;s',
  ),
  'next' => 
  array (
    0 => 'migration81.other-changes.php',
    1 => 'Autres changements',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'appendices/migration81/deprecated.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration81.deprecated" class="sect1">
 <h2 class="title">Fonctionnalités dépréciées</h2>

 <div class="sect2" id="migration81.deprecated.core">
  <h3 class="title">PHP Core</h3>

  <div class="sect3" id="migration81.deprecated.core.serialize-interface">
   <h4 class="title">
    Implémenter <span class="interfacename"><a href="class.serializable.php" class="interfacename">Serializable</a></span> sans
    <span class="function"><strong>__serialize()</strong></span> et <span class="function"><strong>__unserialize()</strong></span>
   </h4>

   <p class="para">
    Seulement les nouvelles méthodes devraient être implémentées, si aucun support pour
    PHP antérieur à la version 7.4 n&#039;est fourni, ou les deux devraient être implémentées.
   </p>
  </div>

  <div class="sect3" id="migration81.deprecated.core.null-not-nullable-internal">
   <h4 class="title">Passer <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> au paramètres non nullable des fonctions natives</h4>

   <p class="para">
    Les types scalaires des fonctions natives sont nullable par défaut.
    Ce comportement est déprécié pour s&#039;aligner sur le comportement des fonctions
    définies par l&#039;utilisateur, où les types scalaires doivent être marqués comme nullable explicitement.

    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">str_contains</span><span style="color: #007700">(</span><span style="color: #DD0000">"foobar"</span><span style="color: #007700">, </span><span style="color: #0000BB">null</span><span style="color: #007700">));<br /></span><span style="color: #FF8000">// Deprecated: Passing null to parameter #2 ($needle) of type string<br />//             is deprecated<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

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

  <div class="sect3" id="migration81.deprecated.core.implicit-float-conversion">
   <h4 class="title">Conversions implicites incompatibles de <a href="language.types.float.php" class="link">nombre décimal</a> en <a href="language.types.integer.php" class="link">entier</a> </h4>

   <p class="para">
    La conversion implicite de <a href="language.types.float.php" class="link">nombre décimal</a> en <a href="language.types.integer.php" class="link">entier</a> qui
    entraîne une perte de précision est maintenant dépréciée.
    Cela affecte les clés de <a href="language.types.array.php" class="link">tableau</a>, les déclarations de type <a href="language.types.integer.php" class="link">entier</a> en mode coercitif,
    et les opérateurs travaillant sur des <a href="language.types.integer.php" class="link">entier</a>s.
    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$a </span><span style="color: #007700">= [];<br /></span><span style="color: #0000BB">$a</span><span style="color: #007700">[</span><span style="color: #0000BB">15.5</span><span style="color: #007700">]; </span><span style="color: #FF8000">// déprécié, car la valeur de la clé perd la composante 0.5<br /></span><span style="color: #0000BB">$a</span><span style="color: #007700">[</span><span style="color: #0000BB">15.0</span><span style="color: #007700">]; </span><span style="color: #FF8000">// ok, car 15.0 == 15<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

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

  <div class="sect3" id="migration81.deprecated.core.static-trait">
   <h4 class="title">Appeler un élément <span class="modifier">static</span> sur un trait</h4>

   <p class="para">
    Appeler une méthode <span class="modifier">static</span>, ou accéder à une
    propriété <span class="modifier">static</span> directement sur un trait est déprécié.
    Les méthodes et propriétés statiques devraient seulement être accédées sur une classe utilisant le trait.
   </p>
  </div>

  <div class="sect3" id="migration81.deprecated.core.magic-sleep">
   <h4 class="title">Retourner un non <a href="language.types.array.php" class="link">tableau</a> depuis <span class="function"><strong>__sleep()</strong></span></h4>

   <p class="para">
    Retourner une valeur qui n&#039;est pas un <a href="language.types.array.php" class="link">tableau</a> depuis
    <a href="language.oop5.magic.php#object.sleep" class="link">__sleep()</a> génère maintenant un diagnostic.
   </p>
  </div>

  <div class="sect3" id="migration81.deprecated.core.void-by-ref">
   <h4 class="title">Retourner une référence depuis une fonction <span class="type"><span class="type"><a href="language.types.void.php" class="type void">void</a></span></span></h4>

   <p class="para">
    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function &amp;</span><span style="color: #0000BB">test</span><span style="color: #007700">(): </span><span style="color: #0000BB">void </span><span style="color: #007700">{}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </div>
    Une telle fonction est contradictoire, et émet déjà le
    <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> suivant lorsqu&#039;elle est appelée :
    <code class="literal">Only variable references should be returned by reference</code>.
   </p>
  </div>

  <div class="sect3" id="migration81.deprecated.core.autovivification-false">
   <h4 class="title">L&#039;autovivification depuis <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></h4>
   <p class="para">
    L&#039;autovivification est le processus de création d&#039;un nouvel <a href="language.types.array.php" class="link">tableau</a>
    lors de l&#039;ajout à une valeur.
    L&#039;autovivification est interdite à partir de valeurs scalaires, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> cependant
    était une exception. Ceci est maintenant déprécié.
    <div class="informalexample">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$arr </span><span style="color: #007700">= </span><span style="color: #0000BB">false</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$arr</span><span style="color: #007700">[] = </span><span style="color: #0000BB">2</span><span style="color: #007700">;   </span><span style="color: #FF8000">// déprécié<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </div>
   </p>
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <p class="para">
     L&#039;autovivification depuis <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> et les valeurs indéfinies est toujours autorisée:
     <div class="informalexample">
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// Depuis une valeur indéfinie<br /></span><span style="color: #0000BB">$arr</span><span style="color: #007700">[] = </span><span style="color: #DD0000">'some value'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$arr</span><span style="color: #007700">[</span><span style="color: #DD0000">'doesNotExist'</span><span style="color: #007700">][] = </span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #FF8000">// Depuis null<br /></span><span style="color: #0000BB">$arr </span><span style="color: #007700">= </span><span style="color: #0000BB">null</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$arr</span><span style="color: #007700">[] = </span><span style="color: #0000BB">2</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

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

 </div>

 <div class="sect2" id="migration81.deprecated.ctype">
  <h3 class="title">ctype</h3>

  <div class="sect3" id="migration81.deprecated.ctype.nonstring-arguments">
   <h4 class="title">Vérifier des arguments non chaîne de caractères</h4>

   <p class="para">
    Passer un argument non chaîne de caractères est déprécié.
    Dans le futur, l&#039;argument sera interprété comme une chaîne de caractères au lieu
    d&#039;un codepoint ASCII.
    Selon le comportement souhaité, l&#039;argument devrait soit être converti en <a href="language.types.string.php" class="link">chaîne de caractères</a> ou un appel explicite à
    <span class="function"><a href="function.chr.php" class="function">chr()</a></span> devrait être fait.
    Toutes les fonctions <code class="literal">ctype_*()</code> sont affectées.
   </p>
  </div>
 </div>

 <div class="sect2" id="migration81.deprecated.date">
  <h3 class="title">Date</h3>

  <p class="para">
   <span class="function"><a href="function.date-sunrise.php" class="function">date_sunrise()</a></span> et <span class="function"><a href="function.date-sunset.php" class="function">date_sunset()</a></span>
   ont été dépréciées pour <span class="function"><a href="function.date-sun-info.php" class="function">date_sun_info()</a></span>.
  </p>

  <p class="para">
   <span class="function"><a href="function.strptime.php" class="function">strptime()</a></span> a été dépréciée.
   Utiliser <span class="function"><a href="function.date-parse-from-format.php" class="function">date_parse_from_format()</a></span> à la place (pour une analyse indépendante de la locale),
   ou <span class="methodname"><a href="intldateformatter.parse.php" class="methodname">IntlDateFormatter::parse()</a></span> (pour une analyse dépendante de la locale).
  </p>

  <p class="para">
   <span class="function"><a href="function.strftime.php" class="function">strftime()</a></span> et <span class="function"><a href="function.gmstrftime.php" class="function">gmstrftime()</a></span> ont été dépréciées.
   Utiliser <span class="function"><a href="function.date.php" class="function">date()</a></span> à la place (pour un formatage indépendant de la locale),
   ou <span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span> (pour un formatage dépendant de la locale).
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.filter">
  <h3 class="title">Filter</h3>

  <p class="para">
   Les filtres <strong><code><a href="filter.constants.php#constant.filter-sanitize-string">FILTER_SANITIZE_STRING</a></code></strong> et
   <strong><code><a href="filter.constants.php#constant.filter-sanitize-stripped">FILTER_SANITIZE_STRIPPED</a></code></strong> sont dépréciés.
  </p>
  <p class="para">
   La directive <a href="filter.configuration.php#ini.filter.default" class="link">filter.default</a>
   INI est maintenant dépréciée.
   
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.gd">
  <h3 class="title">GD</h3>

  <p class="para">
   Le paramètre <code class="parameter">num_points</code> de <span class="function"><a href="function.imagepolygon.php" class="function">imagepolygon()</a></span>,
   <span class="function"><a href="function.imageopenpolygon.php" class="function">imageopenpolygon()</a></span> et <span class="function"><a href="function.imagefilledpolygon.php" class="function">imagefilledpolygon()</a></span>
   a été déprécié.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.hash">
  <h3 class="title">Hash</h3>

  <p class="para">
   Les fonctions <span class="function"><a href="function.mhash.php" class="function">mhash()</a></span>,
   <span class="function"><a href="function.mhash-keygen-s2k.php" class="function">mhash_keygen_s2k()</a></span>,
   <span class="function"><a href="function.mhash-count.php" class="function">mhash_count()</a></span>,
   <span class="function"><a href="function.mhash-get-block-size.php" class="function">mhash_get_block_size()</a></span>,
   et <span class="function"><a href="function.mhash-get-hash-name.php" class="function">mhash_get_hash_name()</a></span> ont été dépréciées.
   Utiliser les fonctions <code class="literal">hash_*()</code> à la place.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.imap">
  <h3 class="title">IMAP</h3>

  <p class="para">
   La constante <strong><code><a href="imap.constants.php#constant.nil">NIL</a></code></strong> a été dépréciée.
   Utiliser <code class="literal">0</code> à la place.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.intl">
  <h3 class="title">Intl</h3>

  <p class="para">
   Appeler <span class="methodname"><a href="intlcalendar.roll.php" class="methodname">IntlCalendar::roll()</a></span> avec un argument
   <a href="language.types.boolean.php" class="link">booléen</a> est déprécié.
   Utiliser <code class="literal">1</code> et <code class="literal">-1</code> à la place de
   <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> et <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> respectivement.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.mbstring">
  <h3 class="title">Chaîne de caractères multibytes</h3>

  <p class="para">
   Appeler <span class="function"><a href="function.mb-check-encoding.php" class="function">mb_check_encoding()</a></span> avec aucun argument
   est déprécié.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.mysqli">
  <h3 class="title">MySQLi</h3>

  <p class="para">
   La propriété <span class="property"><a href="class.mysqli-driver.php#mysqli-driver.props.driver-version">mysqli_driver::$driver_version</a></span>
   a été dépréciée.
   C&#039;était dénué de sens et obsolète, utiliser <strong><code><a href="reserved.constants.php#constant.php-version-id">PHP_VERSION_ID</a></code></strong>
   à la place.
  </p>

  <p class="para">
   Appeler <span class="methodname"><a href="mysqli.get-client-info.php" class="methodname">mysqli::get_client_info()</a></span> ou
   <span class="function"><a href="mysqli.get-client-info.php" class="function">mysqli_get_client_info()</a></span> avec l&#039;argument
   <code class="parameter">mysqli</code> a été déprécié.
   Appeler <span class="function"><a href="mysqli.get-client-info.php" class="function">mysqli_get_client_info()</a></span> sans argument
   pour obtenir l&#039;information de version de la bibliothèque cliente.
  </p>

  <p class="para">
   La méthode <span class="methodname"><a href="mysqli.init.php" class="methodname">mysqli::init()</a></span> a été dépréciée.
   Remplacer les appels à <span class="methodname"><strong>parent::init()</strong></span> par
   <span class="methodname"><strong>parent::__construct()</strong></span>.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.oci8">
  <h3 class="title">OCI8</h3>

  <p class="para">
   La directive INI <a href="oci8.configuration.php#ini.oci8.old-oci-close-semantics" class="link">oci8.old_oci_close_semantics</a>
   est dépréciée.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.odbc">
  <h3 class="title">ODBC</h3>

  <p class="para">
   <span class="function"><a href="function.odbc-result-all.php" class="function">odbc_result_all()</a></span> a été déprécié.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.pdo">
  <h3 class="title">PDO</h3>

  <p class="para">
   Le mode de récupération <strong><code><a href="pdo.constants.fetch-modes.php#pdo.constants.fetch-serialize">PDO::FETCH_SERIALIZE</a></code></strong> a été déprécié.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.pgsql">
  <h3 class="title">PgSQL</h3>

  <p class="para">
   Ne pas passer l&#039;argument de connexion à toutes les fonctions <code class="literal">pgsql_*()</code>
   a été déprécié.
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.soap">
  <h3 class="title">SOAP</h3>

  <p class="para">
   L&#039;option <code class="literal">ssl_method</code> de
   <span class="methodname"><a href="soapclient.construct.php" class="methodname">SoapClient::__construct()</a></span> a été dépréciée
   en faveur des options de contexte de flux SSL.
   
  </p>
 </div>

 <div class="sect2" id="migration81.deprecated.standard">
  <h3 class="title">Standard</h3>

  <p class="para">
   Appeler <span class="function"><a href="function.key.php" class="function">key()</a></span>, <span class="function"><a href="function.current.php" class="function">current()</a></span>,
   <span class="function"><a href="function.next.php" class="function">next()</a></span>, <span class="function"><a href="function.prev.php" class="function">prev()</a></span>,
   <span class="function"><a href="function.reset.php" class="function">reset()</a></span>, ou <span class="function"><a href="function.end.php" class="function">end()</a></span>
   sur les <a href="language.types.object.php" class="link">objet</a>s est déprécié.
   Soit convertir l&#039;<a href="language.types.object.php" class="link">objet</a> en <a href="language.types.array.php" class="link">tableau</a> avec <span class="function"><a href="function.get-mangled-object-vars.php" class="function">get_mangled_object_vars()</a></span>
   en premier lieu, ou utiliser les méthodes d&#039;une classe qui implémente
   <span class="interfacename"><a href="class.iterator.php" class="interfacename">Iterator</a></span>, tel que <span class="classname"><a href="class.arrayiterator.php" class="classname">ArrayIterator</a></span>, à la place.
  </p>

  <p class="para">
   La directive INI <a href="filesystem.configuration.php#ini.auto-detect-line-endings" class="link">auto_detect_line_endings</a>
   est dépréciée.
   Si nécessaire, gérer manuellement les sauts de ligne <code class="literal">&quot;\r&quot;</code> à la place.
  </p>

  <p class="para">
   Les constantes <strong><code><a href="filesystem.constants.php#constant.file-binary">FILE_BINARY</a></code></strong> et
   <strong><code><a href="filesystem.constants.php#constant.file-text">FILE_TEXT</a></code></strong> ont été dépréciées.
   Elles n&#039;ont jamais eu d&#039;effet.
  </p>
 </div>

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