Setting a reference's type in PHP
<p>I am currently using something like</p>

<pre><code>class User{

    /* @var Contacts*/
    public $contacts = array();
}

$userObj = new User();
$userObj-&gt;contacts[] = new Contact(...);
$userObj-&gt;contacts[] = new Contact(...);
</code></pre>

<p>Tough we can document the type of variable using phpDocumentor, is it also possible to restrict other types of objects to be assigned to the contacts array</p>

<pre><code>$userObj-&gt;contacts[] = 2.3 //should be considered as invalid
</code></pre>
