public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->messageSetWireFormat) && ($filter === null || isset($filter['messageSetWireFormat']))) {
			$output .= "\x08";
			$output .= Binary::encodeVarint((int)$object->messageSetWireFormat);
		}

		if (isset($object->noStandardDescriptorAccessor) && ($filter === null || isset($filter['noStandardDescriptorAccessor']))) {
			$output .= "\x10";
			$output .= Binary::encodeVarint((int)$object->noStandardDescriptorAccessor);
		}

		if (isset($object->deprecated) && ($filter === null || isset($filter['deprecated']))) {
			$output .= "\x18";
			$output .= Binary::encodeVarint((int)$object->deprecated);
		}

		if (isset($object->mapEntry) && ($filter === null || isset($filter['mapEntry']))) {
			$output .= "\x38";
			$output .= Binary::encodeVarint((int)$object->mapEntry);
		}

		if (isset($object->uninterpretedOption) && ($filter === null || isset($filter['uninterpretedOption']))) {
			foreach ($object->uninterpretedOption instanceof \Traversable ? $object->uninterpretedOption : (array)$object->uninterpretedOption as $k => $v) {
				$output .= "\xba\x3e";
				$buffer = UninterpretedOptionMeta::toProtobuf($v, $filter === null ? null : $filter['uninterpretedOption']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		return $output;
	}