title: Getting class name from static function in abstract class
body: <p>I have an abstract class that has a number of static functions (which return a new instance of itself by using <code>new static($args)</code> which works fine), but I can't work out how to get the class name. I am trying to avoid putting</p>
  
  <pre><code>protected static $cn = __CLASS__;
  </code></pre>
  
  <p>but if unavoidable, then its not the end of the world</p>
  
  <pre><code>abstract class ExtendableObject {
      static function getObject() {
          return new static($data);
      }
  
      static function getSearcher() {
          return new ExtendableObjectFinder(/* CLASS NAME CLASS */);
      }
  }
  
  class ExtendableObjectFinder {
      private $cn;
  
      function __construct($className) {
         $this-&gt;cn = $className;
      }
  
      function where($where) { ... }
  
      function fetch() { ... }
  }
  </code></pre>