public function __get($name) { if (isset($this[$name])) { return $this[$name]; } else { throw new \InvalidArgumentException("Property \"{$name}\" does not exist."); } }