Creating PHP class instance with a string
<p>I have two classes:</p>

<p>class <code>ClassOne { }</code> and class <code>ClassTwo {}</code> . I am getting a string which can be either "One" or "Two". 
Instead of using a long switch statement such as:</p>

<pre><code>switch($str) {
   case "One":
       return new ClassOne();
   case "Two":
       return new ClassTwo();
}
</code></pre>

<p>Is there anyway way I can create an instance using a string, i.e. <code>new Class("Class" . $str);</code></p>

<p>Thanks,</p>

<p>Joel</p>
