title: Generics and Type casting
body: <p>Here is very simplified example:</p>
  
  <pre><code>function getList&lt;Tx&gt;():Vector&lt;Tx&gt; {
  
      $values = ['1','2','3','4','5'];
      $list = Vector{};
  
      foreach ($values as $value) {
          $list-&gt;add((Tx) $value);
      }
  
      return $list;
  }
  </code></pre>
  
  <p>For instance I know that $values are numeric, derrived from database fetching results or whatever, but stored as strings. So I want to cast them as int through </p>
  
  <pre><code>Vector&lt;int&gt; $myList = $this-&gt;getList&lt;int&gt;();
  </code></pre>
  
  <p>but</p>
  
  <blockquote>
    <p>Object casts are unsupported. Try 'if ($var instanceof Tx)' or
    'invariant($var instanceof Tx, ...)'. (Naming[2055])</p>
  </blockquote>
  
  <p>So should I use two functions for different types in this case like <code>getListInt():Vector&lt;int&gt;</code> and <code>getListString():Vector&lt;string&gt;</code> or I do miss something?</p>