title: Can I pass a type as parameter in PHP?
body: <p>I'd like to pass (any type, not only PHP's primitives) Type as a function parameter. More like a C++'s template. Is it possible in PHP? imaginary code:</p>
  
  <pre><code>function foo(T a)
  {
     $output = new T();
     //do something.
  }
  </code></pre>
  
  <p>I tried pass the type name as string and then use <code>settype()</code> to the the variable to that type but <code>settype()</code> work only with PHP's primitives types. My goal is actually pass a class type as parameter.</p>