An Array of objects in php
<p><h1> I dont understand this why i get this error! is so simple yet very different in php. </h1></p>

<pre><code>&lt;?php
    $x=new DisplayTaxonomy ();
    $myarray= array();
    $x-&gt;setADTitle("bunkers"); 
    echo $x-&gt;getADTitle();

    $myarray =$x;//i also tried array_push($$x, $myarray); same error
    echo $myarray[0]-&gt;getADTitle();
?&gt;
</code></pre>

<p>Fatal error: Cannot use object of type DisplayTaxonomy as array in C:\xampp\htdocs\wordpress\wp-content\plugins\exec-php\includes\runtime.php(42) : eval()'d code on line 9</p>

<pre><code>&lt;?php
 class DisplayTaxonomy {
    public $ADTitle;
 public function setADTitle($ADTitle)
    {
        $this-&gt;ADTitle = $ADTitle; 
    }
    public function getADTitle()
    {
        return $this-&gt;ADTitle;
    }
?&gt;
</code></pre>
