public function __get($propertyName) { if ($this->throwExceptionInGet) { throw new \DomainException('__get exception: ' . $propertyName); } return "value"; }