title: Accessing PHP Class Constants
body: <p>The PHP manual says </p>
  
  <blockquote>
    <p>Like static members, constant values can not be accessed from an instance of the object. </p>
  </blockquote>
  
  <p>which explains why you can't do this</p>
  
  <pre><code>$this-&gt;inst = new Classname();
  echo $this-&gt;inst::someconstant;
  </code></pre>
  
  <p>but then why does this work?</p>
  
  <pre><code>$this-&gt;inst = new Classname();
  $inst = $this-&gt;inst;
  echo $inst::someconstant;
  </code></pre>