public function offsetGet($index) { $index = (string) $index; if (isset($this->callbacks[$index])) { if (!isset($this->results[$index])) { $this->results[$index] = call_user_func_array($this->callbacks[$index], array($index, $this)); } return $this->results[$index]; } else { return parent::offsetGet($index); } }