Updating submodules
[hiphop-php.git] / hphp / test / slow / rds-effects.php
blob08958fbcbe69023da60a2dd8b1ddf57a09714a6f
1 <?hh
3 abstract final class C {
4 public static darray<string, mixed> $cache = dict[];
7 <<__NEVER_INLINE>>
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.
13 $new = $name[2];
14 C::$cache[$name] = $new;
15 return $new;
18 <<__EntryPoint>>
19 function main() :mixed{
20 set_error_handler((...$args) ==> {
21 for ($i = 0; $i < 17; $i++) {
22 C::$cache[$i] = $i;
24 });
26 print(getchar('test')."\n");
27 print(getchar('no')."\n");