public function offsetGet($offset) { if (!array_key_exists($offset, $this->values)) { throw new InvalidArgumentException(sprintf('The "%s" variable does not exist.', $offset)); } return $this->values[$offset]; }