($value & ~(FLAG_A | FLAG_B | FLAG_C)) === 0
function allCombinations(array $values) : array
{
$current = array_pop($values);
if (count($values) === 0) {
return [0, $current];
}
$subArray = allCombinations($value);
return array_merge(
$subArray,
array_map(
function ($el) use ($current) { return $el + $current; },
$subArray
)
);
}
print_r(allCombinations([1, 2, 6]));
/*
Array {
[0] => 0
[1] => 1
[2] => 2
[3] => 3
[4] => 6
[5] => 7
[6] => 8
[7] => 9
}
const FLAG_A = 1;
const FLAG_B = 2;
const FLAG_C = 4;
if (($value & FLAG_A) === FLAG_A) {
print "Flag A\n";
}
((step == undefined || step == 0) && start < end)
5.812vw + 6.4px