title: PHP: casting to a dynamically determined type
body: <p>I'd like do something like this:  </p>
  
  <pre><code>$type = "int";
  $casted = ($type)$value;
  </code></pre>
  
  <p>This doesn't work. But is there some other way to cast to a dynamically determined type?</p>
  
  <p>Thanks</p>