title: Cannot access self:: when no class scope is active
body: <p>I am trying to use a PHP function from within a public static function like so (I've shortened things a bit):</p>
  
  <pre><code>class MyClass {
  
  public static function first_function() {
  
      function inside_this() {    
              $some_var = self::second_function(); // doesnt work inside this function
      }               
  
      // other code here...
  
  } // End first_function
  
  protected static function second_function() { 
  
      // do stuff
  
  } // End second_function
  
  } // End class PayPalDimesale
  </code></pre>
  
  <p>That's when I get the error "Cannot access self:: when no class scope is active".</p>
  
  <p>If I call <code>second_function</code> outside of the <code>inside_this</code> function, it works fine:</p>
  
  <pre><code>class MyClass {
  
  public static function first_function() {
  
      function inside_this() {    
              // some stuff here  
      }               
  
      $some_var = self::second_function(); // this works
  
  } // End first_function
  
  protected static function second_function() { 
  
      // do stuff
  
  } // End second_function
  
  } // End class PayPalDimesale
  </code></pre>
  
  <p>What do I need to do to be able to use <code>second_function</code> from within the <code>inside_this</code> function?</p>