Referencing to an object property
<p>Is it possible to create a variable that references to its own object property?</p>

<pre><code>&lt;?php

class MyClass
{
    public $num_of_call=array();

    public function call($number)
    {
     if(!isset($this-&gt;num_of_call[$number]))
     {
         $this-&gt;num_of_call[$number] = 1;
         return;
     }
     $counter &amp;= $this-&gt;num_of_call[$number];
     $counter++;
    }
}
</code></pre>

<p>I test it but, but it yields an error 'Undefined variable $counter'<br>
And, if I remove the ampersand, it turns out that it's not a reference since the property <code>num_of_call</code> is still zero.<br>
Is there a way to create an 'alias' (reference) to the object property?<br>
Because, this problem arises when the object property has long name and it's an array, and I want to catch it in the variable caching (if it's possible)</p>