<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.phptoken.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'phptoken.gettokenname.php',
    1 => 'PhpToken::getTokenName',
    2 => 'Renvoie le nom du token.',
  ),
  'up' => 
  array (
    0 => 'class.phptoken.php',
    1 => 'PhpToken',
  ),
  'prev' => 
  array (
    0 => 'phptoken.construct.php',
    1 => 'PhpToken::__construct',
  ),
  'next' => 
  array (
    0 => 'phptoken.is.php',
    1 => 'PhpToken::is',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/tokenizer/phptoken/getTokenName.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="phptoken.gettokenname" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PhpToken::getTokenName</h1>
  <p class="verinfo">(PHP 8)</p><p class="refpurpose"><span class="refname">PhpToken::getTokenName</span> &mdash; <span class="dc-title">Renvoie le nom du token.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-phptoken.gettokenname-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>PhpToken::getTokenName</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span></div>

  <p class="para rdfs-comment">
   Renvoie le nom du token.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-phptoken.gettokenname-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-phptoken.gettokenname-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Un caractère ASCII pour les tokens à un seul caractère,
   ou une des constantes T_* pour les tokens connus (voir <a href="tokens.php" class="xref">Liste des jetons de l'analyseur</a>),
   ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> pour les tokens inconnus.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-phptoken.gettokenname-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple de <span class="function"><strong>PhpToken::getTokenName()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// token connu<br /></span><span style="color: #0000BB">$token </span><span style="color: #007700">= new </span><span style="color: #0000BB">PhpToken</span><span style="color: #007700">(</span><span style="color: #0000BB">T_ECHO</span><span style="color: #007700">, </span><span style="color: #DD0000">'echo'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$token</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTokenName</span><span style="color: #007700">());   </span><span style="color: #FF8000">// -&gt; string(6) "T_ECHO"<br /><br />// token à un seul caractère<br /></span><span style="color: #0000BB">$token </span><span style="color: #007700">= new </span><span style="color: #0000BB">PhpToken</span><span style="color: #007700">(</span><span style="color: #0000BB">ord</span><span style="color: #007700">(</span><span style="color: #DD0000">';'</span><span style="color: #007700">), </span><span style="color: #DD0000">';'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$token</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTokenName</span><span style="color: #007700">());   </span><span style="color: #FF8000">// -&gt; string(1) ";"<br /><br />// token inconnu<br /></span><span style="color: #0000BB">$token </span><span style="color: #007700">= new </span><span style="color: #0000BB">PhpToken</span><span style="color: #007700">(</span><span style="color: #0000BB">10000 </span><span style="color: #007700">, </span><span style="color: #DD0000">"\0"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$token</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTokenName</span><span style="color: #007700">());   </span><span style="color: #FF8000">// -&gt; NULL</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-phptoken.gettokenname-seealso">
  <h3 class="title">Voir aussi</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="phptoken.tokenize.php" class="function" rel="rdfs-seeAlso">PhpToken::tokenize()</a> - S&eacute;pare le code source donn&eacute; en tokens PHP, repr&eacute;sent&eacute;s par des objets PhpToken.</span></li>
   <li><span class="function"><a href="function.token-name.php" class="function" rel="rdfs-seeAlso">token_name()</a> - Retourne le nom d'un &eacute;l&eacute;ment de code source</span></li>
  </ul>
 </div>

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