public function __construct(array $opts) { foreach ($opts as $k => $v) { switch ($k) { case 'defaultValue': $this->defaultValue = $v; $this->defaultValueExists = true; break; case 'defaultValueExists': break; default: $this->{$k} = $v; } } }