<?
class Dummy{}
class Test extends ArrayObject{
public function append(Dummy $value){
parent::append($value);
}
public function offsetSet($index, Dummy $value){
parent::offsetSet($index,$value);
}
}
$d = new Dummy();
$t = new Test();
$t->append($d);
//$t->append('a'); // throws error as expected
PD8KY2xhc3MgRHVtbXl7fQpjbGFzcyBUZXN0IGV4dGVuZHMgQXJyYXlPYmplY3R7CiAgICAgICAgcHVibGljIGZ1bmN0aW9uIGFwcGVuZChEdW1teSAkdmFsdWUpewogICAgICAgICAgICAgICAgcGFyZW50OjphcHBlbmQoJHZhbHVlKTsKICAgICAgICB9CiAgICAgICAgCiAgICAgICAgcHVibGljIGZ1bmN0aW9uIG9mZnNldFNldCgkaW5kZXgsIER1bW15ICR2YWx1ZSl7CiAgICAgICAgICAgIHBhcmVudDo6b2Zmc2V0U2V0KCRpbmRleCwkdmFsdWUpOwogICAgICAgIH0KfQoKJGQgPSBuZXcgRHVtbXkoKTsKJHQgPSBuZXcgVGVzdCgpOwokdC0+YXBwZW5kKCRkKTsKdmFyX2R1bXAoJHQpOwovLyR0LT5hcHBlbmQoJ2EnKTsgLy8gdGhyb3dzIGVycm9yIGFzIGV4cGVjdGVkCg==