3 abstract final class C
{
4 public static darray
<string, mixed> $cache = dict
[];
8 function getchar($name) :mixed{
9 $cached = idx(C
::$cache, $name);
10 if ($cached !== null) return $cached;
11 // This line will raise a notice. In the error handler, we may update
12 // C:$cache, so we can't assume that its value remains unchanged here.
14 C
::$cache[$name] = $new;
19 function main() :mixed{
20 set_error_handler((...$args) ==> {
21 for ($i = 0; $i < 17; $i++
) {
26 print(getchar('test')."\n");
27 print(getchar('no')."\n");