<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.simplexmlelement.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'simplexmlelement.current.php',
    1 => 'SimpleXMLElement::current',
    2 => 'Retourne l\'entr&eacute;e courante',
  ),
  'up' => 
  array (
    0 => 'class.simplexmlelement.php',
    1 => 'SimpleXMLElement',
  ),
  'prev' => 
  array (
    0 => 'simplexmlelement.count.php',
    1 => 'SimpleXMLElement::count',
  ),
  'next' => 
  array (
    0 => 'simplexmlelement.getdocnamespaces.php',
    1 => 'SimpleXMLElement::getDocNamespaces',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/simplexml/simplexmlelement/current.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="simplexmlelement.current" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">SimpleXMLElement::current</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">SimpleXMLElement::current</span> &mdash; <span class="dc-title">Retourne l&#039;entrée courante</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-simplexmlelement.current-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>SimpleXMLElement::current</strong></span>(): <span class="type"><a href="class.simplexmlelement.php" class="type SimpleXMLElement">SimpleXMLElement</a></span></div>


  <div class="warning"><strong class="warning">Avertissement</strong>
   <p class="simpara">
    Antérieur à PHP 8.0, <span class="methodname"><strong>SimpleXMLElement::current()</strong></span> n&#039;était déclarée
    que sur la sous-classe <span class="classname"><a href="class.simplexmliterator.php" class="classname">SimpleXMLIterator</a></span>.
   </p>
  </div>

  <p class="para">
   Cette méthode retourne l&#039;élément courant comme un
   objet <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-simplexmlelement.current-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-simplexmlelement.current-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne l&#039;élément courant comme un objet 
   <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span>.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-simplexmlelement.current-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   Lance une <span class="classname"><a href="class.error.php" class="classname">Error</a></span> en cas d&#039;échec.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-simplexmlelement.current-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.1.0</td>
      <td>
       Une <span class="classname"><a href="class.error.php" class="classname">Error</a></span> est lancée si
       <span class="methodname"><strong>SimpleXMLElement::current()</strong></span> est appelée sur un
       itérateur invalide. Auparavant, <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> était retourné.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-simplexmlelement.current-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Retourne l&#039;élément courant</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$xmlElement </span><span style="color: #007700">= new </span><span style="color: #0000BB">SimpleXMLElement</span><span style="color: #007700">(</span><span style="color: #DD0000">'&lt;books&gt;&lt;book&gt;PHP basics&lt;/book&gt;&lt;book&gt;XML basics&lt;/book&gt;&lt;/books&gt;'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">rewind</span><span style="color: #007700">(); </span><span style="color: #FF8000">// Retour au premier élément, sinon current() ne fonctionne pas<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$xmlElement</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">current</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">object(SimpleXMLElement)#2 (1) {
  [0]=&gt;
  string(10) &quot;PHP basics&quot;
}</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-simplexmlelement.current-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="simplexmlelement.key.php" class="methodname" rel="rdfs-seeAlso">SimpleXMLElement::key()</a> - Retourne la cl&eacute; courante</span></li>
    <li><span class="methodname"><a href="simplexmlelement.next.php" class="methodname" rel="rdfs-seeAlso">SimpleXMLElement::next()</a> - Se d&eacute;place sur l'&eacute;l&eacute;ment suivant</span></li>
    <li><span class="methodname"><a href="simplexmlelement.rewind.php" class="methodname" rel="rdfs-seeAlso">SimpleXMLElement::rewind()</a> - Remet le pointeur au d&eacute;but</span></li>
    <li><span class="methodname"><a href="simplexmlelement.valid.php" class="methodname" rel="rdfs-seeAlso">SimpleXMLElement::valid()</a> - V&eacute;rifie si l'&eacute;l&eacute;ment actuel est valide</span></li>
    <li><span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span></li>
   </ul>
  </p>
 </div>


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