aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/Internal/GPBWire.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/src/Google/Protobuf/Internal/GPBWire.php')
-rw-r--r--php/src/Google/Protobuf/Internal/GPBWire.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/php/src/Google/Protobuf/Internal/GPBWire.php b/php/src/Google/Protobuf/Internal/GPBWire.php
index f75e0861..67eb1bee 100644
--- a/php/src/Google/Protobuf/Internal/GPBWire.php
+++ b/php/src/Google/Protobuf/Internal/GPBWire.php
@@ -403,10 +403,14 @@ class GPBWire
return self::varint32Size($tag);
}
- public static function varint32Size($value)
+ public static function varint32Size($value, $sign_extended = false)
{
if ($value < 0) {
- return 5;
+ if ($sign_extended) {
+ return 10;
+ } else {
+ return 5;
+ }
}
if ($value < (1 << 7)) {
return 1;