<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.reflectionenum.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'reflectionenum.getbackingtype.php',
    1 => 'ReflectionEnum::getBackingType',
    2 => 'Gets the backing type of an Enum, if any',
  ),
  'up' => 
  array (
    0 => 'class.reflectionenum.php',
    1 => 'ReflectionEnum',
  ),
  'prev' => 
  array (
    0 => 'reflectionenum.construct.php',
    1 => 'ReflectionEnum::__construct',
  ),
  'next' => 
  array (
    0 => 'reflectionenum.getcase.php',
    1 => 'ReflectionEnum::getCase',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/reflection/reflectionenum/getbackingtype.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="reflectionenum.getbackingtype" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ReflectionEnum::getBackingType</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.1.0)</p><p class="refpurpose"><span class="refname">ReflectionEnum::getBackingType</span> &mdash; <span class="dc-title">Gets the backing type of an Enum, if any</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-reflectionenum.getbackingtype-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ReflectionEnum::getBackingType</strong></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.reflectionnamedtype.php" class="type ReflectionNamedType">ReflectionNamedType</a></span></span></div>

  <p class="para rdfs-comment">
   If the enumeration is a Backed Enum, this method will return an instance
   of <span class="classname"><a href="class.reflectiontype.php" class="classname">ReflectionType</a></span> for the backing type of the Enum.
   If it is not a Backed Enum, it will return <code class="literal">null</code>.
  </p>

 </div>


 <div class="refsect1 parameters" id="refsect1-reflectionenum.getbackingtype-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">Diese Funktion besitzt keine Parameter.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-reflectionenum.getbackingtype-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   An instance of <span class="classname"><a href="class.reflectionnamedtype.php" class="classname">ReflectionNamedType</a></span>, or <code class="literal">null</code>
   if the Enum has no backing type.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-reflectionenum.getbackingtype-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.2.0</td>
      <td>
       The return type is now declared as <code class="literal">?ReflectionNamedType</code>. Previously,
       <code class="literal">?ReflectionType</code> was declared.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-reflectionenum.getbackingtype-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="methodname"><strong>ReflectionEnum::getBackingType()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">enum </span><span style="color: #0000BB">Suit</span><span style="color: #007700">: </span><span style="color: #0000BB">string<br /></span><span style="color: #007700">{<br />    case </span><span style="color: #0000BB">Hearts </span><span style="color: #007700">= </span><span style="color: #DD0000">'H'</span><span style="color: #007700">;<br />    case </span><span style="color: #0000BB">Diamonds </span><span style="color: #007700">= </span><span style="color: #DD0000">'D'</span><span style="color: #007700">;<br />    case </span><span style="color: #0000BB">Clubs </span><span style="color: #007700">= </span><span style="color: #DD0000">'C'</span><span style="color: #007700">;<br />    case </span><span style="color: #0000BB">Spades </span><span style="color: #007700">= </span><span style="color: #DD0000">'S'</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #0000BB">$rEnum </span><span style="color: #007700">= new </span><span style="color: #0000BB">ReflectionEnum</span><span style="color: #007700">(</span><span style="color: #0000BB">Suit</span><span style="color: #007700">::class);<br /><br /></span><span style="color: #0000BB">$rBackingType </span><span style="color: #007700">= </span><span style="color: #0000BB">$rEnum</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getBackingType</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">((string) </span><span style="color: #0000BB">$rBackingType</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">string(6) &quot;string&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-reflectionenum.getbackingtype-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><a href="language.enumerations.php" class="link">Enumerations</a></li>
    <li><span class="methodname"><a href="reflectionenum.isbacked.php" class="methodname" rel="rdfs-seeAlso">ReflectionEnum::isBacked()</a> - Determines if an Enum is a Backed Enum</span></li>
   </ul>
  </p>
 </div>


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