title: php class extends
body: <p>I want to know is it possible to have a class that's extended have a var set and used from the base class?</p>
  
  <p>eg:</p>
  
  <pre><code>class me
  {
      public $hello = array();
  
      protected function setter($me)
      {
          $this-&gt;hello[] = $me;
      }
  }
  
  class foo extends me
  {
      public function __construct()
      {
          $this-&gt;setter('foo');
      }
  }
  
  class yoo extends me
  {
      public function __construct()
      {
          parent::setter('yoo');
      }
  }
  
  $me = new me();
  $foo = new foo();
  $yoo = new yoo();
  
  print_r($me-&gt;hello);
  </code></pre>
  
  <p>the array printed is array() nothing is set.</p>