title: passing by reference in __clone
body: <p>In my <code>__clone</code> method I'm assigning, by reference, one variable to the other. What I'd expect to happen, after cloning, is that when I change this variable for one object it gets changed in the other object. But that doesn't appear to be happening.</p>
  
  <p>My code:</p>
  
  <pre><code>class a {
      var $a;
  
      function a($var = NULL) {
          if (isset($var)) {
              $this-&gt;a = $var;
          }
      }
  
      function __clone() {
          $temp = new a();
          $temp-&gt;a = &amp;$this-&gt;a;
          return $temp;
      }
  }
  
  $a = new a('test');
  $b = clone $a;
  $b-&gt;a = 'zzz';
  
  echo $a-&gt;a;
  echo "\r\n";
  echo $b-&gt;a;
  </code></pre>
  
  <p>The output is this:</p>
  
  <pre><code>test
  zzz
  </code></pre>
  
  <p>I'd expect it to be this:</p>
  
  <pre><code>zzz
  zzz
  </code></pre>