Object not behaving as reference
<p>In PHP, I assume that every object is reference, however in this code;</p>

<pre><code>  /**
 * adds a master object which affects browse and insert operations
 *
 * @param \bk\dataset\master|string $cursor            
 * @param Array $fields            
 */
function SetMasterCursor ($cursor, $fields)
{
    if (is_object($cursor)) {
        $this-&gt;master = &amp; $cursor; /** !!!!!! **/
    } elseif (is_string($cursor)) {
        $this-&gt;master = \bk\dataset\master::instance($cursor, null, $this-&gt;GetModuleName());
    }
    $this-&gt;_masterfld = $fields;
}
</code></pre>

<p>I need to force PHP to use reference with <code>&amp;</code> operator (<code>$this-&gt;master = &amp; $cursor</code>). If I do not use the operator, it is acting strangely. It is calling constructor of cursor class. So obviously it is not just copying reference. I thought, from PHP5 on <code>$object1 = $object2</code> and <code>$object1 = &amp; $object2</code> are the same, it is just different for other types (string etc.). I got a feeling that my assumption is wrong.</p>