private function bitwiseIn(
        $max,
        $matching
    ) {
        $result = [];
        for ($i = 1; $i <= $max; ++$i) {
            if ($i & $matching) {
                $result[] = $i;
            }
        }

        return $result;
    }