add bitset operations and tests
[hiphop-php.git] / hphp / test / slow / apc / uncounted_array_copy.php
bloba6020416ace650951c35880eb957f57793e75781
1 <?hh
3 function makeNonStatic($n) {
4 $s = 'foobar';
5 for ($i = 0; $i < $n; $i += 1) {
6 $s .= $i;
8 return $s;
11 // Runs twice with Treadmill in between (see .opts)
12 if (apc_exists('minefield')) {
13 // Second run: verify array was correctly copied.
14 var_dump(apc_fetch('minefield'));
15 } else {
16 // First run: Create array with uncounted, non-static string value.
17 $ns = makeNonStatic(10);
18 apc_store('mine', $ns, 3);
19 $unc0 = apc_fetch('mine');
20 $unc1 = apc_fetch('mine');
21 $v = array();
22 $v['hey'] = $unc0;
23 $v[] = $unc1;
24 var_dump($v);
25 // This should recursively copy all of 'v' before storing in APC...
26 apc_store('minefield', $v, 100);
27 // ...since its values can easily go away (after Treadmill runs):
28 apc_delete('mine');