3 function nextBit(inout
int $x): bool {
9 function testOne(int $case): void
{
10 $left = nextBit(inout
$case) ? Map
{} : dict
[];
11 $right = nextBit(inout
$case) ? Map
{} : dict
[];
12 if (nextBit(inout
$case)) $left['a'] = 'a';
13 if (nextBit(inout
$case)) $left[1] = 'i';
14 if (nextBit(inout
$case)) $left['1'] = 's';
15 if (nextBit(inout
$case)) $right['a'] = 'x';
16 if (nextBit(inout
$case)) $right[1] = 'y';
17 if (nextBit(inout
$case)) $right['1'] = 'z';
20 if (count($left) === 0 ||
count($right) === 0) return;
22 $res = array_intersect_key($left, $right);
24 $left is Map
<_
> ?
'm' : 'd',
25 isset($left['a']) ?
'a' : ' ',
26 isset($left[1]) ?
'i' : ' ',
27 isset($left['1']) ?
's' : ' ',
29 $right is Map
<_
> ?
'm' : 'd',
30 isset($right['a']) ?
'a' : ' ',
31 isset($right[1]) ?
'i' : ' ',
32 isset($right['1']) ?
's' : ' ',
41 function main(): void
{
42 for ($i = 0; $i < 256; $i++
) testOne($i);