madlisp/src/Hash.php

21 lines
377 B
PHP
Raw Normal View History

2020-05-28 04:55:58 +00:00
<?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");
}
2020-06-02 12:17:18 +00:00
public function set(string $key, $value)
{
$this->data[$key] = $value;
return $value;
}
2020-05-28 04:55:58 +00:00
}