How to declare class in namespace from string
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4513366/php-namespace-with-dynamic-class-name">PHP namespace with Dynamic class name</a>  </p>
</blockquote>



<p>How to declare class from string?</p>

<h1>code</h1>

<pre><code>$name = 'the_class';
require_once $name.'.php';
$class = new \resource\$name();
</code></pre>

<h1>error</h1>

<pre><code>Parse error: syntax error, unexpected '$name' (T_VARIABLE), expecting identifier (T_STRING)
</code></pre>
