mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 21:35:03 +00:00
21 lines
377 B
PHP
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;
|
|
}
|
|
}
|