title: Why this Output is BarBarBar and not FooBarFoo?
body: <p>I am starting to learn PHP and have a problem understanding this:</p>
  
  <pre><code>&lt;?php
  
  class Model {
      public $text = "Foo";
  }
  
  class Controller {
      public $model;
      public function __construct(Model $model) {
          $this-&gt;model = $model;
      }
  }
  
  class View {
      public $model;
      public function __construct(Model $model) {
          $this-&gt;model = $model;
      }   
  }
  
  $model = new Model();
  $controller = new Controller($model);
  $view = new View($model);
  
  $controller-&gt;model-&gt;text = "Bar";
  
  echo $model-&gt;text;
  echo $controller-&gt;model-&gt;text;
  echo $view-&gt;model-&gt;text;
  
  ?&gt;
  </code></pre>
  
  <p>I just changed the valor of text of the object model property of the controller class. I think this has to do with some references.</p>