Array Push is not working
<p>I have created a class in following way</p>

<pre><code> class History
    {
      private  $historyArray;
      private $cacheFileNameArray=array();
      public function __construct()
      {
       $this-&gt;historyArray=array();
      } 
      public function writeToHistory($query)
      {
       $cacheFileName=$this-&gt;getCacheFileName();
       $query=$query.chr(219)."1".chr(219).$cacheFileName;
       array_push($this-&gt;historyArray,$query);
       print_r($this-&gt;historyArray);
      }
     }  
</code></pre>

<p>Now i have created an object of class History as h,then i'm calling the function writeToHistory() two times with 2 different argument by i wonder that array_push() is not working cause in time of 2nd calling of the function the query should be written in the 1 index of the array but actually the first element of the array is being replaced.Any idea why?</p>
