oop - PHP: Passing in an Array of type Object to the constructor? -


While defining a constructor I used to do something similar in the beginning:

  public Function __construct (MyClass $ class) {...}   

Although I wanted to be able to accept an array of MyClasses, how can you define it in your constructor?

Cheers

Not strictly typed, but whatever you want Will apply

  public function __ composition (Ar $$) {as foreach ($ inst $$ inst) {if ((Inst! Inst example of className)) {trigger_error ('creator For example, there should be examples of classname in the array of objects passed ', E_USER_ERROR); } // actions}}    

Comments