The proto3 spec, the maximum field number allowed is 2^29-1. In the PHP code, this number is being limited to 2147483647 >> 3, or 2^28-1.
As a result, the serialization of any proto field with a field number greater than 2^28-1 is failing when using the PHP protobuf native library and extension.
message TestMessage {
string description = 456214797;
}
// serialize
$message = new TestMessage();
$message->setDescription('this string will not be serialized');
$serializedMessage = $message->serializeToString();
// unserialize
$message2 = new TestMessage();
$message2->mergeFromString($serializedMessage);
var_dump($message2->getDescription());
// outputs an empty string ('')
The proto3 spec, the maximum field number allowed is 2^29-1. In the PHP code, this number is being limited to
2147483647 >> 3, or 2^28-1.As a result, the serialization of any proto field with a field number greater than 2^28-1 is failing when using the PHP protobuf native library and extension.