title: How to access parent's class property if the current class has been instantiated in the parent
body: <p>I'm experimenting with MVC trying to make a simple framework. This is an example of what I'm doing:</p>
  
  <pre><code>&lt;?php
  require_once('config.php'); //Here I have the Config object
  class App{
      protected $config;
      protected $controller;
      public function init(){
          $this-&gt;config = new Config;
          $this-&gt;controller = new Main_Controller;
      }
  }
  class Main_Controller extends App{
      public function __construct(){
          var_dump($this-&gt;config);
      }
  }
  $app = new App;
  $app-&gt;init();
  </code></pre>
  
  <p>The problem is that my var_dump is returning NULL, so why isn't Main_Controller reading that App property?</p>