An Array of objects in php
===

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

    <?php
        $x=new DisplayTaxonomy ();
        $myarray= array();
        $x->setADTitle("bunkers"); 
        echo $x->getADTitle();
        
        $myarray =$x;//i also tried array_push($$x, $myarray); same error
        echo $myarray[0]->getADTitle();
    ?>

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

    <?php
     class DisplayTaxonomy {
        public $ADTitle;
     public function setADTitle($ADTitle)
        {
            $this->ADTitle = $ADTitle; 
        }
        public function getADTitle()
        {
            return $this->ADTitle;
        }
    ?>
