diff --git a/helpers.php b/helpers.php index c14918a..535e036 100644 --- a/helpers.php +++ b/helpers.php @@ -21,7 +21,11 @@ function option(string|array|null $key = null, mixed $default = null, DateInterv } if (is_array($key)) { - $option->set($key[0], $key[1], $ttl); + if (array_is_list($key)) { + $option->set($key[0], $key[1], $ttl); + } else { + $option->set(key($key), current($key), $ttl); + } } return $option;