aboutsummaryrefslogtreecommitdiff
path: root/php/src/Google/Protobuf/Internal/Message.php
diff options
context:
space:
mode:
Diffstat (limited to 'php/src/Google/Protobuf/Internal/Message.php')
-rw-r--r--php/src/Google/Protobuf/Internal/Message.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/php/src/Google/Protobuf/Internal/Message.php b/php/src/Google/Protobuf/Internal/Message.php
index 9765e09b5..1ff2dc9a6 100644
--- a/php/src/Google/Protobuf/Internal/Message.php
+++ b/php/src/Google/Protobuf/Internal/Message.php
@@ -832,6 +832,9 @@ class Message
if (is_null($value)) {
return $this->defaultValue($field);
}
+ if (is_numeric($value)) {
+ return strval($value);
+ }
if (!is_string($value)) {
throw new GPBDecodeException(
"String field only accepts string value");