title: How can I access class constants using `self::` inside an anonymous function defined in a method?
body: <p>I would like to access a class constant using <code>self</code> from within an anonymous function.</p>
  
  <pre><code>class My_Class {    
      const  CLASS_CONSTANT = 'test value';
      private function my_function(){     
          $lambda_function = function(){
              echo self::CLASS_CONSTANT;
          };
          $lambda_function();
      }
  }
  </code></pre>
  
  <p>When I tried this, I get the error:</p>
  
  <blockquote>
    <p>Fatal error: Cannot access self:: when no class scope is active in ...</p>
  </blockquote>
  
  <p>Is it possible to pass the parent class into the scope of this anonymous function?  Would a <code>use</code> statement work?</p>