title: Extending PHP static classes
body: <p>I've been struggling in this area for days now, and I have reached a conclusion, but since the conclusion was not what I was looking for, before I give up, I'll try to see what other people say. Faith dies last...</p>
  
  <p>Let's say we have a superclass (called "Super") and a subclass (called "Sub").</p>
  
  <pre><code>class Super {
      protected static $title = 'super';
      public static function get_class_name()        
      {
          echo __CLASS__;
      }
      public static function get_title()
      {
          echo self::$title;
      }
  }
  class Sub extends Super {
      protected static $title = 'sub';
  }
  </code></pre>
  
  <p>Now, you would probably expect since Sub extends Super, that Sub would now inherit all of Super's methods, however, it seems to only receive references to the Sub's methods.</p>
  
  <p>I say this because if I call:</p>
  
  <pre><code>Sub::get_class_name();
  </code></pre>
  
  <p>the output is "Super", and not "Sub".</p>
  
  <p>And if I call:</p>
  
  <pre><code>Sub::get_title();
  </code></pre>
  
  <p>again, the output is "super", and I even have the $title declared in Sub.</p>
  
  <p>So this means that when I call an inherited static function, the function's scope will be the super class, not the one called upon (even if you print the backtrace, it will show that the call was made on the superclass!!!), and in order to obtain the scope as the subclass that the call is being made upon, I need to redeclare that method inside that subclass. <b>Well this kind of defeats the purpose of extending classes, don't it?</b></p>
  
  <p>So my question is, can I ever extend a static class, call one of the inherited methods and have the subclass's scope? or at least to be able to identify it's classname?
  And if not, why would I ever want to extend static classes?</p>
  
  <p>Thanks!</p>