$value) { $this->{$key} = $value; } } /** * Magic method __get * * This method is called when an undefined property is accessed. * It returns null instead of triggering an E_NOTICE. * * @param string $index The name of the property being accessed. * @return null Always returns null for undefined properties. */ public function __get(string $index): null { return null; } }