Php dynamic class construction
<p>I'm trying to avoid the use of <code>eval</code>. I can dynamically instantiate a class like this:</p>

<pre><code>class myclass {}

$my_class_name = 'myclass';
$obj = new $myclass();
</code></pre>

<p>If the constructor is like follows:</p>

<pre><code>class myclass {
    public function __construct( $argument1, $argument2 ) {}
}
</code></pre>

<p>and i have the values of the arguments in an array, how can i dynamically instantiate the class <strong>and</strong> pass it dynamic arguments? Mind that I have no way to modify the class, so I have to work on the way of using it.</p>

<p>Thanks</p>
