madlisp/src/Hash.php
2020-06-02 19:17:18 +07:00

21 lines
377 B
PHP

<?php
namespace MadLisp;
class Hash extends Collection
{
public function get(string $key)
{
if ($this->has($key)) {
return $this->data[$key];
}
throw new MadLispException("hash does not contain key $key");
}
public function set(string $key, $value)
{
$this->data[$key] = $value;
return $value;
}
}