code: public static function calculateBitmask(array $options)
      {
          $bitmask = 0;
  
          foreach ($options as $optionName) {
              if (\defined($optionName)) {
                  $bitmask |= \constant($optionName);
              }
          }
  
          return $bitmask;
      }
docs: Calculate a bitmask for given constant names.
  
  @param string[] $options constant names
  
  @return int