add方法应该只接受对象。所以这就是我们想要的行为:$obj=new Foo; //arbitrary object
$collection->add($x); //should throw an error because $x is not an object
根据PHP因为所有的PHP类都是<e
$obj = new stdClass(); return;
abc($obj); //Catchable fatal error: Argument 1 passed to abc() must be an instance of object, instance of stdClass可捕获的致命错误:传递给abc()的参数1必须是对象</em