class Class1 {
public function test1() {}
}
class Class2 {
public function test2() {}
}
class Class3 extends Class1 {
protected $parent;
public function __construct() {
$this->parent = new Class2();
}
public function __call(string $method_name, array $arguments) {
return call_user_func([$this->parent, $method_name], $arguments);
}
}
$example = new Class3();
$example->test2();