public function __get($name) { switch ($name) { case 'nextElementSibling': return $this->getNextElementSibling(); case 'previousElementSibling': return $this->getPreviousElementSibling(); } return $this->getParentProperty($name); }