<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.reflection.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'class.reflectionclassconstant.php',
    1 => 'ReflectionClassConstant',
    2 => 'The ReflectionClassConstant class',
  ),
  'up' => 
  array (
    0 => 'book.reflection.php',
    1 => 'Reflection',
  ),
  'prev' => 
  array (
    0 => 'reflectionclass.tostring.php',
    1 => 'ReflectionClass::__toString',
  ),
  'next' => 
  array (
    0 => 'reflectionclassconstant.construct.php',
    1 => 'ReflectionClassConstant::__construct',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/reflection/reflectionclassconstant.xml',
  ),
  'history' => 
  array (
  ),
  'extra_header_links' => 
  array (
    'rel' => 'alternate',
    'href' => '/manual/en/feeds/class.reflectionclassconstant.atom',
    'type' => 'application/atom+xml',
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="class.reflectionclassconstant" class="reference">

 <h1 class="title">The ReflectionClassConstant class</h1>
 

 <div class="partintro"><p class="verinfo">(PHP 7 &gt;= 7.1.0, PHP 8)</p>


  <div class="section" id="reflectionclassconstant.intro">
   <h2 class="title">Introduction</h2>
   <p class="para">
    The <span class="classname"><strong class="classname">ReflectionClassConstant</strong></span> class reports
    information about a class constant.
   </p>
  </div>


  <div class="section" id="reflectionclassconstant.synopsis">
   <h2 class="title">Class synopsis</h2>


   <div class="classsynopsis"><div class="classsynopsisinfo">
    
     <span class="modifier">class</span> <strong class="classname"><strong class="classname">ReflectionClassConstant</strong></strong>
    

    
     <span class="modifier">implements</span>
      <a href="class.reflector.php" class="interfacename">Reflector</a> {</div>

    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Constants */</div>
    <div class="fieldsynopsis">
     <span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-public"><var class="varname">IS_PUBLIC</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-protected"><var class="varname">IS_PROTECTED</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-private"><var class="varname">IS_PRIVATE</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="modifier">const</span>
     <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      <var class="fieldsynopsis_varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-final"><var class="varname">IS_FINAL</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Properties */</div>
    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
      <var class="varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.props.name">$<var class="varname">name</var></a></var>;</div>

    <div class="fieldsynopsis"><span class="modifier">public</span>
     <span class="type"><a href="language.types.string.php" class="type string">string</a></span>
      <var class="varname"><a href="class.reflectionclassconstant.php#reflectionclassconstant.props.class">$<var class="varname">class</var></a></var>;</div>


    <div class="classsynopsisinfo classsynopsisinfo_comment">/* Methods */</div>
    <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.construct.php" class="methodname">__construct</a></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.object.php" class="type object">object</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$class</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$constant</code></span>)</div>

    <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><a href="reflectionclassconstant.export.php" class="methodname">export</a></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$class</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$return</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getattributes.php" class="methodname">getAttributes</a></span>(<span class="methodparam"><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> <code class="parameter">$name</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getdeclaringclass.php" class="methodname">getDeclaringClass</a></span>(): <span class="type"><a href="class.reflectionclass.php" class="type ReflectionClass">ReflectionClass</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getdoccomment.php" class="methodname">getDocComment</a></span>(): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getmodifiers.php" class="methodname">getModifiers</a></span>(): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getname.php" class="methodname">getName</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.gettype.php" class="methodname">getType</a></span>(): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.reflectiontype.php" class="type ReflectionType">ReflectionType</a></span></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.getvalue.php" class="methodname">getValue</a></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.hastype.php" class="methodname">hasType</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.isdeprecated.php" class="methodname">isDeprecated</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.isenumcase.php" class="methodname">isEnumCase</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.isfinal.php" class="methodname">isFinal</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.isprivate.php" class="methodname">isPrivate</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.isprotected.php" class="methodname">isProtected</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.ispublic.php" class="methodname">isPublic</a></span>(): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>
<div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><a href="reflectionclassconstant.tostring.php" class="methodname">__toString</a></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

   }</div>


  </div>

  

  <div class="section" id="reflectionclassconstant.props">
   <h2 class="title">Properties</h2>
   <dl>
    
     <dt id="reflectionclassconstant.props.name"><var class="varname">name</var></dt>
     <dd>
      <p class="para">
       Name of the class constant. Read-only, throws
       <span class="classname"><a href="class.reflectionexception.php" class="classname">ReflectionException</a></span> in attempt to write.
      </p>
     </dd>
    
    
     <dt id="reflectionclassconstant.props.class"><var class="varname">class</var></dt>
     <dd>
      <p class="para">
       Name of the class where the class constant is defined. Read-only, throws
       <span class="classname"><a href="class.reflectionexception.php" class="classname">ReflectionException</a></span> in attempt to write.
      </p>
     </dd>
    
   </dl>
  </div>



  <div class="section" id="reflectionclassconstant.constants">
   <h2 class="title">Predefined Constants</h2>
   <div class="section" id="reflectionclassconstant.constants.modifiers">
    <h2 class="title">ReflectionClassConstant Modifiers</h2>
    <dl>

     
      <dt id="reflectionclassconstant.constants.is-public">
       <strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-public">ReflectionClassConstant::IS_PUBLIC</a></code></strong>
       <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      </dt>
      <dd>
       <p class="para">
        Indicates <a href="language.oop5.visibility.php" class="link">public</a>
        constants.
        Prior to PHP 7.4.0, the value was <code class="literal">256</code>.
       </p>
      </dd>
     

     
      <dt id="reflectionclassconstant.constants.is-protected">
       <strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-protected">ReflectionClassConstant::IS_PROTECTED</a></code></strong>
       <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      </dt>
      <dd>
       <p class="para">
        Indicates <a href="language.oop5.visibility.php" class="link">protected</a>
        constants.
        Prior to PHP 7.4.0, the value was <code class="literal">512</code>.
       </p>
      </dd>
     

     
      <dt id="reflectionclassconstant.constants.is-private">
       <strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-private">ReflectionClassConstant::IS_PRIVATE</a></code></strong>
       <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      </dt>
      <dd>
       <p class="para">
        Indicates <a href="language.oop5.visibility.php" class="link">private</a>
        constants.
        Prior to PHP 7.4.0, the value was <code class="literal">1024</code>.
       </p>
      </dd>
     

     
      <dt id="reflectionclassconstant.constants.is-final">
       <strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-final">ReflectionClassConstant::IS_FINAL</a></code></strong>
       <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
      </dt>
      <dd>
       <p class="para">
        Indicates <a href="language.oop5.final.php" class="link">final</a>
        constants. Available as of PHP 8.1.0.
       </p>
      </dd>
     

    </dl>
    <blockquote class="note"><p><strong class="note">Note</strong>: 
     <p class="para">
      The values of these constants may change between PHP versions.
      It is recommended to always use the constants
      and not rely on the values directly.
     </p>
    </p></blockquote>
   </div>
  </div>


  <div class="section">
   <h2 class="title">Changelog</h2>
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.4.0</td>
       <td>
        The class constants are now typed.
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <span class="methodname"><a href="reflectionclassconstant.export.php" class="methodname">ReflectionClassConstant::export()</a></span> was removed.
       </td>
      </tr>

     </tbody>
    
   </table>

  </div>
 </div>

 



















































































<h2>Table of Contents</h2><ul class="chunklist chunklist_reference"><li><a href="reflectionclassconstant.construct.php">ReflectionClassConstant::__construct</a> — Constructs a ReflectionClassConstant</li><li><a href="reflectionclassconstant.export.php">ReflectionClassConstant::export</a> — Export</li><li><a href="reflectionclassconstant.getattributes.php">ReflectionClassConstant::getAttributes</a> — Gets Attributes</li><li><a href="reflectionclassconstant.getdeclaringclass.php">ReflectionClassConstant::getDeclaringClass</a> — Gets declaring class</li><li><a href="reflectionclassconstant.getdoccomment.php">ReflectionClassConstant::getDocComment</a> — Gets doc comments</li><li><a href="reflectionclassconstant.getmodifiers.php">ReflectionClassConstant::getModifiers</a> — Gets the class constant modifiers</li><li><a href="reflectionclassconstant.getname.php">ReflectionClassConstant::getName</a> — Get name of the constant</li><li><a href="reflectionclassconstant.gettype.php">ReflectionClassConstant::getType</a> — Gets a class constant's type</li><li><a href="reflectionclassconstant.getvalue.php">ReflectionClassConstant::getValue</a> — Gets value</li><li><a href="reflectionclassconstant.hastype.php">ReflectionClassConstant::hasType</a> — Checks if class constant has a type</li><li><a href="reflectionclassconstant.isdeprecated.php">ReflectionClassConstant::isDeprecated</a> — Checks if deprecated</li><li><a href="reflectionclassconstant.isenumcase.php">ReflectionClassConstant::isEnumCase</a> — Checks if class constant is an Enum case</li><li><a href="reflectionclassconstant.isfinal.php">ReflectionClassConstant::isFinal</a> — Checks if class constant is final</li><li><a href="reflectionclassconstant.isprivate.php">ReflectionClassConstant::isPrivate</a> — Checks if class constant is private</li><li><a href="reflectionclassconstant.isprotected.php">ReflectionClassConstant::isProtected</a> — Checks if class constant is protected</li><li><a href="reflectionclassconstant.ispublic.php">ReflectionClassConstant::isPublic</a> — Checks if class constant is public</li><li><a href="reflectionclassconstant.tostring.php">ReflectionClassConstant::__toString</a> — Returns the string representation of the ReflectionClassConstant object</li></ul>
</div>
<?php manual_footer($setup); ?>