param = array(); foreach($param as $key => $val) { $this->param[$key] = $val; } $this->param2 = 'Какая-то муть_3'; } /* function __get($key) { if(array_key_exists($key, $this->param)): return $this->param[$key]; elseif(isset($this->$key)): return $this->$key; else: throw new Exception('Ошибка'); endif; }*/ } ?> param['str']; echo '
'; echo $show->param['str2']; echo '
'; echo $show->param2; ?>