title: PHP Cast to my class
body: <p>why this is not possible:</p>
  
  <pre><code>$user = (User) $u[0];
  </code></pre>
  
  <p>but this is possible</p>
  
  <pre><code>$bool = (boolean) $res['success'];
  </code></pre>
  
  <p>I use PHP 7.0.</p>