is a good practice to use array of objects in php?
<p>For example, it is a good practice to do this in php:</p>

<p>I have a class test, it is a controller class where I instantiate the view and the model class, but what if I need to instantiate if another model I would have to create another object, instead of that I create an array of objects that holds the instances of each model or view:</p>

<pre><code> class test extends Controller{

    //The vars $Model and $View are arrays declared in the parent class

    public function __construct(){
        parent::__construct();
        $this-&gt;Model["testModel"] = new testModel();
        $this-&gt;Model["otherModel"] = new otherModel();
        $this-&gt;View["testView"] = new testView();
    }

    public function index_action(){
        $this-&gt;View["testView"]-&gt;assign("name", $this-&gt;getParam("name"));
        $this-&gt;View["testView"]-&gt;showTestTemplate();
    }

    public function other_method(){

        echo "Hello world";

    }

}
</code></pre>

<p>is only a sample class, wanted to know if it is a good practice to do so.
thanks</p>
