You shouldn't be using static members:
class Templater { private array $params = array();[]; public function assign($name, $value) : self { $this->$params[$name]>params[$name] = $value; return $this; } public function draw() { //not really sure whatdo yousomething wantwith here$this->params } } $test = (new Templater())->assign('key', 'value')->assign('key2', 'value2')->draw();