Basically, I am looking for a way I could optimize the following. Not really a PHP programmer, and in the Ruby world this would be easy, but at the moment I have this:
if(count($methods) == 1) {
$resp = $this->$methods[0];
}
else if(count($methods) > 1) {
$resp = $this->$methods[0]->$methods[1];
}
Is there somehow a way I could loop over the methods array here, and chain them together?
Thanks!