public function __get($property) { switch ($property) { case 'state': return $this->state; case 'stack': return $this->stack; default: return parent::__get($property); } }