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