php classes object issue
<pre><code>&lt;?php

$instance = new SimpleClass();

$assigned   =  $instance;
$reference  =&amp; $instance;

$instance-&gt;var = '$assigned will have this value';

$instance = null; // $instance and $reference become null

var_dump($instance);
var_dump($reference);
var_dump($assigned);
?&gt; 
</code></pre>

<p>what is the difference between below given 2 lines?</p>

<pre><code>$assigned   =  $instance;
$reference  =&amp; $instance; 
</code></pre>

<p>as in OOP object is by default assign by reference . so $assigned will also have 
&amp; $instance.</p>

<p>output of above code is </p>

<pre><code>NULL
NULL
object(SimpleClass)#1 (1) {
   ["var"]=&gt;
     string(30) "$assigned will have this value"
}
</code></pre>
