requireConfig($class); foreach ($if_arr as $if_nam => $if_impl) { // build interface instance $if_cls = new ReflectionClass($if_impl); $if = $if_cls->newInstance(); $if_met = "set$if_nam"; $method = new ReflectionMethod($class, $if_met); $method->invoke($instance, $if); } } }