$index)) { return $this->$index; } else { throw new AttributeException($index); } } public function __set(string $index, string $value) : void { if (isset($this->$index)) { $this->$index = $value; } else { throw new AttributeException($index); } } public function isPasswordCorrect($password) { return $this->password == $password; } }