public function __construct($arr = []) { foreach ($arr as $k => $v) { if (!is_object($v)) { $e = new Generic(); $e->setHumanValue($v); $this->{$k} = $e; } else { $this->{$k} = $v; } } }