title: Storing php object's property in another object as a reference
body: <p>Is it possible to store a reference to an object's property (class member variable which holds a scalar data such as string or integer) within an object of a different class?</p>
  
  <p>I am trying to have the following two echo statements produce identical results.</p>
  
  <pre><code>&lt;?php
  
  $x = new Type;
  $x-&gt;name = 'abcd';
  
  echo "x.name=" . $x-&gt;name . '&lt;br/&gt;';
  echo "x.obj.name=" . $x-&gt;obj-&gt;value . '&lt;br/&gt;';
  
  class Type
  {
      public $obj; //Instance of Property (Property class defined below)
      public $name;
  
      function __construct()
      {
          $this-&gt;obj = new Property($this-&gt;name);
      }
  }
  
  class Property
  {
      public $value;
  
      function __construct($v)
      {
          $this-&gt;value = $v;
      }
  }
  </code></pre>