php forcing type
<p>I have a collegue who constantly assigns variable and forces their type.  For example he would declare something like so:</p>

<pre><code>$this-&gt;id = (int)$this-&gt;getId();
</code></pre>

<p>or when returning he will always return values as such:</p>

<pre><code>return (int)$id;
</code></pre>

<p>I understand that php is a loosely typed language and so i am not asking what the casting is doing.  I am really wondering what the benefits are of doing this - if any - or if he is just wasting time and effort in doing this?</p>
